Welcome Guest Search | Active Topics | Sign In | Register

ASPXToPDF Scaling Options
Rocco
Posted: Tuesday, May 22, 2012 1:33:35 PM
Rank: Newbie
Groups: Member

Joined: 3/21/2012
Posts: 8
Using the ASPXtoPDF control, is it possible to Scale (ex: 110%) or Scale to Fit?

If so, what property needs to be set?

Rocco.
eo_support
Posted: Tuesday, May 22, 2012 1:54:38 PM
Rank: Administration
Groups: Administration

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

There are several properties that would affect scaling factor:

http://www.essentialobjects.com/doc/4/eo.pdf.htmltopdfoptions.autofitx.aspx
http://www.essentialobjects.com/doc/4/eo.pdf.htmltopdfoptions.autofity.aspx
http://www.essentialobjects.com/doc/4/eo.pdf.htmltopdfoptions.zoomlevel.aspx

You can take a look of the above links to see what each of these properties is for. If you want to precisely control zoom level, you can set both AutoFitX and AutoFitY to None and then set ZoomLevel.

Note you would set all these properties through HtmlToPdf.Options object (for example, HtmlToPdf.Options.AutoFitX = ...). They are not on the ASPXToPDF control.

Thanks!
Rocco
Posted: Tuesday, May 22, 2012 2:38:43 PM
Rank: Newbie
Groups: Member

Joined: 3/21/2012
Posts: 8
Those properties are exactly what I need, but I see no way to use them with the ASPXToPDF control. Is there some way to assign htmltopdfoptions settings to the ASPXToPDF control? Could you please post a few lines of code as an example? I have not seen any in the downloads.

eo_support
Posted: Tuesday, May 22, 2012 2:41:54 PM
Rank: Administration
Groups: Administration

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

I am not sure what you meant by it sees no way to use them with ASPXToPDF control. You just use them, for example:

Code: C#
HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.None;


Make sure you call it before you call RenderAsPDF.

Thanks
Rocco
Posted: Wednesday, May 23, 2012 9:21:10 AM
Rank: Newbie
Groups: Member

Joined: 3/21/2012
Posts: 8
HtmlToPdf is one object and AspxToPdf is a different object. The code provided shows how to set autofit for the HtmlToPdf object, which does not have a RenderAsPDF method. AspxToPdf does have RenderAsPDF, but does not have autofit capability. Based on your response, it is only possible to set autofit for HtmlToPdf and NOT for AspxToPdf.

>> "I am not sure what you meant by it sees no way to use them with ASPXToPDF control."
I can put it in a non-technical analogy:
* my brother (AspxToPdf) and sister (HtmlToPdf) are related but not the same person
* I can tell my sister (HtmlToPdf) that I want my brother (AspxToPdf) to do something (autofit)
* I cannot tell my brother (AspxToPdf) that I want him to do it (autofit)
* Just telling my sister (HtmlToPdf) does not affect the results of my brother (AspxToPdf).
So, I was asking if/how HtmlToPdf can tell AspxToPdf to autofit.


If any developers have a solution, please post.
eo_support
Posted: Wednesday, May 23, 2012 10:13:04 AM
Rank: Administration
Groups: Administration

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

You just use them. These two work together. ASPXToPDF sits ON TOP OF HtmlToPdf. So everything eventually goes through HtmlToPdf. Usually you do not have to talk to HtmlToPdf directly when you use ASPXToPDF. However when you need advanced features such as scaling, you go talk with HtmlToPdf directly.

I have no idea what you were referring when you say "I can not tell my sister". If you want to talk with your sister (HtmlToPdf), you go talk with your sister. If your sister is not around, you find her first. What does that has to do with your brother? HtmlToPdf is a standard .NET class defined in EO.Pdf.dll. You use it the same as you use any other .NET class. It's really very simple and straight forward and you seem to be unnecessarily thinking it as more complicated than it actually is.

Thanks!
Rocco
Posted: Tuesday, May 29, 2012 11:57:00 AM
Rank: Newbie
Groups: Member

Joined: 3/21/2012
Posts: 8
It worked exactly as you said. Thank you!


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.