|
Rank: Member Groups: Member
Joined: 2/6/2012 Posts: 21
|
In the 2011 version of EO.Pdf ViewerPreference.FitWindow = true used to work as expected and have the document open up in Adobe Reader with View / Zoom set to Zoom to page level. It's now opening up in Fit Width mode in the 2012 version (v4.0.24.2). Here's a snippet of the my code that worked in 2011 as expected:
Code: C#
var pdfOptions = new HtmlToPdfOptions
{
NoLink = true,
PreserveHighResImages = true,
SaveImageAsJpeg = false,
NoScript = true,
BaseUrl = baseUrl.AbsoluteUri,
PageSize = PdfPageSizes.A4,
AutoBookmark = true,
FooterHtmlFormat = footerHtml,
HeaderHtmlFormat = headerHtml,
};
PdfDocument pdf = new PdfDocument();
EO.Pdf.HtmlToPdf.ConvertHtml(html, pdf, pdfOptions);
pdf.PageMode = PdfPageMode.UseOutlines;
pdf.Document.ViewerPreference.FitWindow = true;
The setting now seems to have no effect.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
This might be something Adobe has changed. We could not find any code changes regarding that in 2012. We also tried the same code with 2011.2 and got the same result. Pdf specification does not have a "FitWidth" viewer preference option. So maybe Adobe decided "FitWidth" is a better interpretation of "FitWindow"?
Of course, we might be wrong on that because there are so many different 2011.2 builds and we just happened have tried the "wrong" one. So if you know exactly which 2011.2 build produces the "right" file we will happy to try it again.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 2/6/2012 Posts: 21
|
Actually I've gone back through the versions and they all seem to behave the same way as the latest code: that is FitWindow doesn't appear to do anything much. So it's not a regression from your point of view!
It guess could be that there's a difference between Adobe Reader 9 and Adobe Reader X in their handling of this setting - i.e. Adobe Reader X ignores it.
In any case, consider the case closed :-)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
OK. Thanks for the update!
|
|