|
Rank: Newbie Groups: Member
Joined: 11/9/2011 Posts: 6
|
Hello,
I am using HtmlToPDF feature and I have noticed that blank text boxes are not saved in the PDF document the same way as text boxes with some string. I was hoping that replacing text box with a label and adding border around will help to solve this issue, but instead I have vertical pipeline when the string in the label is blank. In my html (aspx page) I use stylesheet that defines the length of the label, its border color and width. I can see all these empty labels fine on my web page, but when the PDF document is created some are missing bottom border some are just vertical lines. Is there something that can be done about it (besides skipping borders around the label control)?
Thank you!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
This usually has to do with your zoom level. Try to zoom out your Adobe Reader and you will see the line appear. Unlike Windows GDI, PDF uses float coordinates. Sometimes when they are not aligned to device pixel they do not appear. Usually zooming out the page will show them again. They will always show fine on printer.
If that's not the problem, please try to create a test page demonstrating the problem and we will be happy to take a look.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/9/2011 Posts: 6
|
Hello,
The problem that I am seeing could be related to multiline text box or label control with more than one line of text. If you provide me with the e-mail address I can send you the pdf, however, I will not be able to provide public access to the web page at this time. In case someone runs into this problem here are details how to reproduce:
1. On the aspx. add multiline text box control and call it txtBox1. Set its style to: font-size: 12px; font-family: Arial, Helvetica, sans-serif; border-color:#FF9900; border-style:solid; border-width:1pt; width:596px 2. Set the txtBox1.Text to some long text (150 characters should be ok, but use spaces in between just as you would type few sentences). 3. On the same .aspx page add label control and call it lblBox1 and set its style to be the same as above. Set lblBox1.Text to the same text as for the txtBox1 4. Save your .aspx page as pdf using recommended method from the help doc: EO.Pdf.HtmlToPdf.ConvertUrl("yourUrl://test.aspx", "c:\\result.pdf");
(NOTE: I assume the EO.Pdf dll is added to your bin dir)
5. Open your PDF document and compare borders around text box and label controls to your .aspx page. The page looks fine but the pdf has borders around each line.
On my end I see border lines at the top and bottom of each line, but the left and right borders show only at the first and last line of text.
My current fix for this is to skip borders and bold the text but it is not what i wanted to do. If you have any suggestions on how to preserve borders but only around the entire text or label control, please let me know.
Best regards,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Thank you very much for the additional information. This is normal. There are different ways to interpret left and right borders on an inline object. IE interprets it as left and right on all lines, while almost all other browsers (FireFox, Chrome, Safari) interprets it as only at the start and end line. Our interpretation is with the "other browsers" on this issue.
Our rendering is most close to Google Chrome and Safari. So you can use either of those two browsers to verify the output. You should see our output is very much the same as theirs.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/9/2011 Posts: 6
|
Are you suggesting that PDF document opened in IE will look different than PDF opened in Safari? I guess you can only force this scenario when your default browser is set to either of them.
However, this is not the issue....I can see borders fine on all browsers IE, Safari, etc. The problem is the PDF document that is the result of the call to : EO.Pdf.HtmlToPdf.ConvertUrl("yourUrl://test.aspx", "c:\\result.pdf");
Maybe I am missing something here, but if my .aspx page looks fine in all browsers, why the PDF is not?
Thank you,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
No. That's not what we meant. What we meant is the same web page (in this case your ASP.NET page) can look differently in different browser. So there are multiple different "rendering" of the same Web page. As a test, you can try the above steps you described in blank page and open the page with IE and FireFox. You will see left and right borders in the middle lines for the Label control in IE, but not in FireFox.
Thanks
|
|