Welcome Guest Search | Active Topics | Sign In | Register

HTML to PDF Options
rbsandoval
Posted: Friday, October 3, 2014 6:36:23 PM
Rank: Newbie
Groups: Member

Joined: 10/3/2014
Posts: 1
When converting html to PDF, is there any way to predetermine the viewing mode. I noticed that PDFs can scale to the size of the iFrame or the embedded object viewer.

I also noticed that some browsers display the PDF differently. Firefox show the PDF in full width view based on the size of the browser window -- it scales proportionately. Chrome shows it at one size only and it does not scale.

Any trick to getting the PDF to scale on all browsers (IE11, FF, Chrome and Safari) and mobile browser (Android and iOS)?

Thanks.
eo_support
Posted: Friday, October 3, 2014 8:40:19 PM
Rank: Administration
Groups: Administration

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

You can take a look of this class:

http://www.essentialobjects.com/doc/4/eo.pdf.pdfviewerpreference.aspx

The code will be something like this:

Code: C#
//Convert into a PdfDocument object
PdfDocument doc = new PdfDocument();
HtmlToPdf.ConvertUrl(url, doc);

//Set the FitWindow ViewerPreference. See the above link
//for other available ViewerPreference properties
doc.ViewerPreference.FitWindow = true;


However as the name suggest, it's a "preference", so a viewer (in your case, a browser) may decide not to honor it. So if you already tried it and still does not work, then probably there is no way to do it since these properties are directly mapped to the corresponding flags in the PDF file.

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.