|
Rank: Newbie Groups: Member
Joined: 11/16/2015 Posts: 6
|
Hi EO, We are currently experiencing problems with 'EO.Web for MVC.net'. Whenever we convert a .cshtml to PDF we are experiencing random scaling of the content on the output PDF. The scaling varies with every export we make.
The only (seemingly) scaling we use for the conversion is as following: MVCToPDF.RenderAsPDF(); HtmlToPdf.Options.PageSize = PdfPageSizes.A4; HtmlToPdf.Options.OutputArea = new RectangleF(0.5f, 0.5f, 7.5f, 10f);
We are currently using version: 17.2.43
We also have tried setting the following values to 'None' autofit X / autofix Y. and tried using a @Page property for scaling but our output keeps getting scaled randomly resulting into zoomed-in or zoomed-out content on the PDF. Are you familiar with such problems and what would be a solution we could try?
Regards
|
|
Rank: Newbie Groups: Member
Joined: 11/16/2015 Posts: 6
|
We have currently updated to the last version of EO.PDF that is compatible with .Net 4.5 Framework, which is 21.1.85. But the scaling issues keep occuring.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, Setting AutoFitX to None would disable scaling. However all options you set must be set BEFORE you call RenderAsPDF. Calling it afterwards has no effect. Another way to control auto scaling is to force the converter to see a bigger page width. For example, you can put something in your page like this:
Code: HTML/ASPX
<div style="width:1024px;height:1px;"></div>
This will force the converter to see your page as at least 1024px wide. Page width is what determines the scale factor. If you only wants to force page width in the PDF converter, you can do it with JavaScript like this:
Code: HTML/ASPX
<div id="forceConverterWidth" style="height:1px;"></div>
Code: JavaScript
if (eoapi && eoapi.isEOPdf())
document.getElementById("forceConverterWidth").style.width = "1024px";
Hope this helps. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/16/2015 Posts: 6
|
Hi eo_support,
Using the autofix and other calls before the RenderAsPDF call actually did the trick and we are now able to generate a PDF that doesnt scale randomly.
Thank you for the explanation!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Great. Glad to hear that it's working for you!
|
|