Rank: Newbie Groups: Member
Joined: 2/6/2017 Posts: 1
|
Hi,
I downloaded the trial version and was able to convert a web page into a PDF. I was also able to create a header and footer that is repeated on each page. Note that it is the same header and footer for each page (the header has an image/logo, and the footer has the current date and Page 1 of 3 for example). Pretty simple stuff.
What I needed the software to do was also be able to create custom information (as text) to be displayed on each header and footer for each page. This information will be the same on some page headers and footers in a sequential fashion but then will change when a new section is encountered (so the information will not always be the same on each page header and footer).
I need to do this after the PDF is created. I know there is some post processing that can be done after the conversion. It is at that time that I want to print custom header and footer text based on the page information. For example, the header would be a very small 2 to 3 line text summary (almost like a title) of the page contents and the footer would be the name of the file for the page and the date it was created. In other words, the entire PDF document contains a compilation of different pages created on different days with different file contents. One file can span more than one page, so there is repetition in the header and footer in these cases. You can think of the different pages as "sections" in a document, such as an executive summary, then an overview, then the subject matter (which can contain its own sections), followed by a glossary and/or helpful hyperlinks to other documents.
Can this be handled by this software? We would be looking into the EO.PDF portion of your tools.
Thank you
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Yes. You can do that with our software. The following code demonstrates how to "stamp" additional output on the first page of the conversion result:
Code: C#
//Generates the main contents
PdfDocument doc = new PdfDocument();
HtmlToPdf.ConvertUrl(your_url, doc);
//Set the output area to the header area
HtmlToPdf.Options.OutputArea = new Rectangle(0, 0, 6.5f, 1f);
//Add additional output to the first page
HtmlToPdf.ConvertHtml("header", doc.Pages[0]);
The key here are: 1. For the main contents conversion, the second argument is a PdfDocument object. Do not use a file name here as you will need to add additional output to this PdfDocument; 2. When you add additional output, you can ConvertHtml with the second argument as a PdfPage object and also explicitly set HtmlToPdf.Options.OutputArea. This allows you to add any output to arbitrary locations in any PdfPage. You can put that part into a loop if you need to create the same output on more than one page. Hope this helps. Please let us know if you still have any questions. Thanks!
|