Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPdf scaling with full width? Options
Nigrimmist
Posted: Monday, April 6, 2015 12:45:23 PM
Rank: Newbie
Groups: Member

Joined: 4/6/2015
Posts: 3
Hi, can i generate page to pdf with scaled height, BUT for full width (i know, that result image will be resized and has disproportion).
Now, it scaled both - x and y, but i need only y.

Thanks!
eo_support
Posted: Monday, April 6, 2015 1:15:11 PM
Rank: Administration
Groups: Administration

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

During the HTML to PDF stage, there will be only one scale factor and it is always applied to both X and Y, so it is impossible to change the output disproportion in this stage.

After the HTML to PDF, you can apply a transformation matrix to the whole page with this method:

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

Here you can change it whatever way you want.

Thanks!
Nigrimmist
Posted: Tuesday, April 7, 2015 5:39:24 AM
Rank: Newbie
Groups: Member

Joined: 4/6/2015
Posts: 3
Thanks for answer, but seems that scale transfrom not working porperly. I see only blank pdf as a result.

Using "<b>test</b>" html as test and next code for transform :

PdfMatrix matrix = new PdfMatrix();
matrix.Scale(0,2.0F);

doc.Pages.ForEach(x => x.Transform(matrix));
doc.Save(stream);
eo_support
Posted: Tuesday, April 7, 2015 11:10:58 AM
Rank: Administration
Groups: Administration

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

Why do you use 0 as the X scale factor? Scale is multiplying. When you multiply anything with 0 you get 0.

Thanks!
Nigrimmist
Posted: Tuesday, April 7, 2015 11:29:09 AM
Rank: Newbie
Groups: Member

Joined: 4/6/2015
Posts: 3
Yeap, 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.