Welcome Guest Search | Active Topics | Sign In | Register

Image scaling issue...Image is splitting to 2nd page Options
RahulRK
Posted: Monday, April 22, 2013 9:35:50 AM
Rank: Newbie
Groups: Member

Joined: 4/16/2013
Posts: 2
Hi,

In my project I am converting HTML to PDF. HTML is having 2 images in it.
After converting to PDF, when I view the PDF, 2nd Image is splitting and going to the next page. I have this Image scaling issue.Llooking for a resolution for this issue.

I have tried to refer the below article from support and need help on this.
http://www.essentialobjects.com/doc/4/htmltopdf/image_size.aspx

In the above mentioned link, LoadImage method is used which loads the image and returns a System.Drawing.Image object as mentioned below:
protected System.Drawing.Image LoadImage(string image)
{
Stream stream =
typeof(Demo).Assembly.GetManifestResourceStream("EOPDFDemo.Images." + image);
return System.Drawing.Image.FromStream(stream);
}

I don't know how to use this above mentioned method in my project. I am not sure what this Demo should have? Please, guide me here.

Also, would be interested in knowing is there any better/easy way to solve the Image scaling/splitting to next page.

Thanks in Advance.
eo_support
Posted: Monday, April 22, 2013 9:41:44 AM
Rank: Administration
Groups: Administration

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

I am not sure if you are using HTML to PDF. If you use HTML to PDF, you can use page-break-inside:avoid on the image tag to avoid the image being split.

http://www.essentialobjects.com/doc/4/htmltopdf/paging.aspx

Thanks!
RahulRK
Posted: Monday, April 22, 2013 11:08:30 AM
Rank: Newbie
Groups: Member

Joined: 4/16/2013
Posts: 2
Hi,

Thanks for the reply.

It works. But my requirement is it should happen automatically/programatically, when I convert HTML to PDF.
I need this to happen in one of the following way:
1. Is there a way through which I automatically set the manual paging mentioned by you.

2. OR how can I go inside the html and modify the page break(not manually).

Thanks again!

eo_support
Posted: Monday, April 22, 2013 11:18:45 AM
Rank: Administration
Groups: Administration

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

You will have to modify the HTML. However you do not have to modify it on every img tag. What you can do is to add the following CSS rule that would apply to all images in the page:

Code: CSS
img { page-break-inside: avoid; }


Hope this helps.

Thanks!
smoothing
Posted: Thursday, May 30, 2013 4:32:01 AM
Rank: Newbie
Groups: Member

Joined: 5/30/2013
Posts: 1
Im newly on such an image processing project .I found image scaling sdk in .NET when putting "image scale" in Google, does this library work?Any help will be highly appriecated.
eo_support
Posted: Thursday, May 30, 2013 9:15:03 AM
Rank: Administration
Groups: Administration

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

This is the wrong place for you to ask image processing question. This thread is about our HTML to PDF converter product.

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.