Welcome Guest Search | Active Topics | Sign In | Register

ASPX To PDF in VS 2008 Application Options
jayan
Posted: Wednesday, October 8, 2014 11:28:11 AM
Rank: Newbie
Groups: Member

Joined: 10/8/2014
Posts: 2
Hey I am using ASPX To PDF functionality in VS 2008 Asp.Net Application,Could you please help me to resolve the below issues

1) Need to give a heading with an image in the right side of the pdf page
2) How we can able to change the zooming to a particular size for all the pdf result pages.

Your earliest reply is appreciable

Sincerely,
Jayan
eo_support
Posted: Wednesday, October 8, 2014 2:03:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

Thanks for posting in the forum. Please do not make duplicate posts in the forum. We have deleted your other post and the other user name. As to your questions:

1. You will need to handle ASPXToPDF's AfterRender event and then add additional contents to the page. For example, you can do something like this:

Code: C#
//Get the conversion result
HtmlToPdfResult result = (HtmlToPdfResult)ASPXToPDF1.Result;

//Loop through all pages of the result document
PdfDocument doc = result.PdfDocument;
for (int i = 0; i < doc.Pages.Count; i++)
{
   PdfPage page = doc.Pages[i];

   //Set your output area correctly
   HtmlToPdf.Options.OutputArea = .....

   //Output some HTML into the page
   HtmlToPdf.ConvertHtml(header_html, page);
}


The main difference here is the second argument of ConvertHtml is a PdfPage object, not a PdfDocument object. If the header is very simple, then you can also use the "PDF Creator" interface to generate the output. PDF Creator interface is much less powerful than HTML to PDF converter but is also much faster.

2. Please see here for more information about page zooming:

http://www.essentialobjects.com/doc/4/htmltopdf/auto_fit.aspx

You will need to set the HtmlToPdf.Options properties before you call RenderAsPDF.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
jayan
Posted: Thursday, October 9, 2014 1:21:49 PM
Rank: Newbie
Groups: Member

Joined: 10/8/2014
Posts: 2
Hi,

Thank you for the update also could you please help me which i mentioned in the 1st question, how we can add an Image also in the Header in AspxToPdf also the 2 question

2) How we can able to change the zooming to a particular size for all the pdf result pages.
eo_support
Posted: Thursday, October 9, 2014 4:25:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi Jayan,

We have already told you how to render additional HTML to a page. You can put anything, including images in your HTML. Just remember to set HtmlToPdf.Options.BaseUrl correctly if you use partial image Urls in your HTML.

I believe the link we posted in our previous reply has already answered your second question.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.