Welcome Guest Search | Active Topics | Sign In | Register

Fluid layout and image resizing Options
Moslem Ben Dhaou
Posted: Wednesday, October 17, 2012 7:40:46 AM
Rank: Newbie
Groups: Member

Joined: 10/17/2012
Posts: 5
Hi,

I work for an IT company and we are trying to evaluate which component shall we use for our products PDF generation features. EO is on the top of the list now but we still have 2 questions:

1/ Our web application is using Fluid CSS (using percentages instead of pixels count for height/width) in order to allow adaption to the user screen. Our tests with EO showed that the converter is using a relatively small window which make the text very close and somehow compressed :



instead of



Is there a way to specify how big the browser window should be when converting?

2/ What options would allow me to re size pictures inside the page? some of the picture are huge and they get cropped



Thank you!
eo_support
Posted: Wednesday, October 17, 2012 8:18:55 AM
Rank: Administration
Groups: Administration

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

The easiest way to "resize" the "window" is to put a fixed width element in your HTML. The converter tries to detects the minimum window width automatically. For example, if you have something like this in your page:

Code: HTML/ASPX
<div style="height:1px;width:1000px;">
</div>


Then the converter will see this element has a minimum width of 1000px and will use that width as the "window width" (unless there is something else that's even wider).

As to resize picture, I think it's related to your question #1. If you resolve the window width issue. The image should no longer be an issue. If you just want to resize the image, you can just size width and height attribute on your img element. The converter does not have any option for you to alter a specific HTML element. This is necessary so that the converter will render everything the same way as your browser does. As such anything you want to do, you do it in your HTML.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Moslem Ben Dhaou
Posted: Wednesday, October 17, 2012 9:39:47 AM
Rank: Newbie
Groups: Member

Joined: 10/17/2012
Posts: 5
Hi,

For the second question that sound reasonable. For the first I am trying to avoid setting the width explicitly because I would like to keep the fluid design.
The good news is that I came up with a solution, which is to make the math on how big my page should be and assign the page size and the output area values. Having 96dpi as the default DPI and wanting to have 1024px as minimum width, that will lead to 11inch as the width and multiplied by the square root of 2 to get the height. It is all then about adding the margin I need. This worked but it would be great if this gets included in the converter options probably in next versions. The other side effect is that the page is bigger than A4 and ScaleToFit is not helping bringing it down since we already explicitly set those value, not sure about the zoom I will try that.

One more thing I just discovered: when using gray scale images (8bit definition), the image is shown blurred. Any workaround for that?

Thank you!
eo_support
Posted: Wednesday, October 17, 2012 10:11:17 AM
Rank: Administration
Groups: Administration

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

Thank you very much for the feedback on the page size. We will see what we can do to make it easier. Another way that we could consider is to add an HtmlToPdf.Options.MinPageWidth property. That way you can set that to 1024 directly on the converter without having to change your HTML. Please let us know if that option sounds easier to you.

As to changing HTML, there is also a different way to do it. You can add JavaScript code in your HTML to detect whether your page is running inside our converter. If it is running inside our converter, you can show the div that would be used to force the page width. Otherwise that div would have "display:none" and would have no effect if viewed in a browser. You can find more information on our JavaScript interface here:

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

As to the gray scale image, we are not aware of such issue. can you send us a test project so that we can look into it? We will PM you as to where to send.

Thanks!
eo_support
Posted: Wednesday, October 17, 2012 11:05:45 AM
Rank: Administration
Groups: Administration

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

We tested the image file you sent to us and it works fine here.

We need you to ISOLATE the problem into a test project and send us the source code of the TEST PROJECT. We DO NOT need your real project source code. In another word, you must try to duplicate the problem in a separate problem and send that project to us so that we can duplicate the problem here. We can't do much unless we can duplicate the problem here first.

Thanks!
Moslem Ben Dhaou
Posted: Wednesday, October 17, 2012 11:10:41 AM
Rank: Newbie
Groups: Member

Joined: 10/17/2012
Posts: 5
Hi,

I will try to do my best for that.

Thank you for your assistance!
eo_support
Posted: Wednesday, October 17, 2012 2:14:55 PM
Rank: Administration
Groups: Administration

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

We have looked into the page width issue again. You can increase the page width by setting HtmlToPdf.Options.ZoomLevel to a value less than 1. For example:

Code: C#
HtmlToPdf.Options.ZoomLevel = 0.5f;


Will double the page width.

Hope this helps.

Thanks!
Moslem Ben Dhaou
Posted: Thursday, October 18, 2012 2:17:12 AM
Rank: Newbie
Groups: Member

Joined: 10/17/2012
Posts: 5
Hi,

I uploaded the sample image to http://i50.tinypic.com/5xp1y.jpg (8bit depth picture)

please try to use the EO.PDF.Demo application and convert this link. You will get the same issue with blurred images

I am still working on preparing a test project. I was suspecting a 3rd party Grid control since in our solution the image is displayed within the grid, but using the link above gives me the same results I have sent you in the email yesterday.

Best regards
eo_support
Posted: Thursday, October 18, 2012 8:13:53 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Thanks. We are able to reproduce the problem. So no test project needed. We will look into it and get back to you as soon as possible.
eo_support
Posted: Thursday, October 18, 2012 2:24:56 PM
Rank: Administration
Groups: Administration

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

We have posted a new build that should fix this problem. Please see your private message for the download location.

Thanks!
Moslem Ben Dhaou
Posted: Thursday, October 18, 2012 2:35:10 PM
Rank: Newbie
Groups: Member

Joined: 10/17/2012
Posts: 5
That is just FABULOUS! Thank you!

It is just a matter of time till Omada becomes a client :) We really appreciate your high commitment and quick answers!

Thank you!
eo_support
Posted: Thursday, October 18, 2012 2:39:30 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Glad to hear that! Please feel free to let us know if there is anything else.


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.