PDF Generation dynamically - c#

I am working on PDF generation dynamically, I have pdf template and I am creating the similar dynamically using ITextSharp,I am creating the pdf and returning base64 string to mobile app,which then convert the base64 to pdf.
The template is like this
See Image
The footer's disclaimer and page number will appear in all pages of PDF file, and page number is dynamic too.
I have created it successfully, it is not exactly same as of the template, Is there any other way to generate PDF without ITextsharp?
Can I use crystal report or RDLC for this or any other,that fulfils my requirements.(dynamic page number,disclaimer and page in all pages and base64 string).
The content of center table can be multiple ,so the pdf can be of more then one pages.
The difference of generated pdf is that center's table width is going out,it should align with top two tables(I have 100% for three tables),there are other issues as well.

Generating footer and header with ItextSharp is not native,
so you need to code it manually.
Here, is a good Example:
https://www.codeproject.com/Tips/573907/Generating-PDF-using-ItextSharp-with-Footer-in-Csh

Related

Aspose pdf how to set order of tagged content

We are using SSRS to generate reports in pdf, recently we converted to SSRS2019 to enable acessibility in generated pdf reports
The issue we are facing is the order of the paragraphs in the PDF tagged content.
We are considering using Aspose pdf to fix the tagged content order issue rather than regenerating the whole report using other generation tool
Using Aspose pdf we were able to fix some other issues as well but still have no clue about how to set paragraph ordering
All we got is the Page TabOrder property which is set to Default
Question is there any way we can control tab order of generated tagged content tab order assuming report file is composed of three simple tables

Convert asp.net page to Word document

I have built several PDF documents dynamically from ASP.NET pages (HTML/CSS) using plugins like Winnovative HtmlToPDFconverter. It has always been a successful outcome using the built-in functionality for those plugins, like merging existing PDF documents with dynamic content and adding pre-defined headers and footers, adding page margins, page numbers and so forth. The HTML content has overall been rendered as expected in the final PDF document(s).
Is there any way/any advice for a similar .NET plugin that can render HTML/CSHTML to a Microsoft Word document (.docx) in the same way – or is it too difficult to render native HTML5 and CSS into a desirable layout for a Microsoft Word Document?
I have googled around and found some suggestions, but I'm looking for recommendations for maybe a specific plugin – or a warning if it is a no-go
and too difficult to get the desired layout 1:1 from HTML to a Word document because of incompatibility between markups?
Devexpress HTML editor can export its HTML content to different formats including docx and rtf. Not sure about its limitations (e.g. script and canvas export, etc.), but in the common case it works well.

Page counter for HTML Renderer for PDF using PDFSharp

I would like to put the page number of each page of a pdf file generated by HTML Renderer for PDF using PDFSharp which is an amazing plugin using PDFSharp and giving the possibility to render a pdf file from html string, moreover it supports CSS 2 to style the generated pdf.
Thanks to this pull request, which is available in the beta version, it is possible to have a proper paging with elements not being cut when they are taller than the page format.
I tried using this in the css:
.footer:after
{
counter-increment: page;
content: counter(page);
}
with no success (the footer being in a fixed position). I would like to know if someone achieved a proper page count with this plugin or if someone knew another way.
I already tried to simulate the pages count the document would take but the styling in browser is quite different from the generated pdf file (lines height, margins management, etc).

Search and Replace PDF using Itext

I need to generate a PDF based on some user inputs. The output PDF have some images, tables and texts. I think that Itext is not user friendly for programmatically generate this report.
Since the report I need to generate is quite complicated, I was wondering if it is possible to create a template PDF and then load -> search -> replace the strings/images I want.
The template PDF can be a tagged pdf.
Is it possible to do that?
Is it the best approach?
EDIT: I´m using WPF + MVVM + .Net 3.5
Replacing text within a PDF file is not simple. The PDF fileformat uses a dictionary at the file end where elements are listet with their byte offset within the file, also some elements have a field where they give their own length given in bytes. If these offsets are not met, the reader will probably report a broken pdf.
You should have a look at reporting as it is made for these tasks:
http://msdn.microsoft.com/en-us/library/bb885185%28v=vs.100%29.aspx
You can create a template with the report designer, set your data and export it to pdf.

asp.net html 2 pdf and overlay pdf file

i want to generate a PDF file with tables, etc in it. so what i did is using a PDF converter (EVO PDF). that works great, except that the PDF has a white background-color.
What I wanted to do is to overlay a PDF document (because our company paperwork) and put the HTML above it. But because the HTML has a white background, I can't get it work.
I'm now using EVOPDF to generate the HTML and Syncfusion to overlay the company paperwork..
there must be an easier way
Convert the company stationary into a flat image, and then set that as the background to the page in CSS. As long as care is taken to measure and set sizing right, that should work for you.

Categories