Rank: Member Groups: Member
Joined: 10/17/2013 Posts: 22
|
I have an HTML with a watermark. After conversion to PDF it seems to disappear. After playing with the rotate/left/top properties I realized that it is simply located "above" the first page. I also have a different HTML with a watermark, which seems OK
The specific code segments: (If you need, I can send also both HTML examples with good and bad PDF result)
#watermark { color: #f0f0f0; font-size: 150pt; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); position: absolute; width: 80%; height: 80%; margin: 0; z-index: -1; left: 50px; top: -150px; }
<div id="watermark"><p>Trial Version</p></div>
Thanks
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, Yes. Please send us the HTML files. You can find more information on how to send us test files here: http://www.essentialobjects.com/forum/test_project.aspxOnce we have the file, we can take a look and see what we can find. In the mean time, you can try to use PDF Creator interface to create watermark: http://www.essentialobjects.com/doc/4/acm/pdf%20content%20api/text.aspxHope this helps. Thanks!
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
We have looked into the test files you sent to us. Please remove this line from your watermark style:
height: 80%;
The difference between a regular browser and the HTML to PDF converter is HTML to PDF converter usually has a much bigger "window". When you open a web page on screen, your browser window's size is usually limited by your screen size. However our HTML to PDF converter does not have this restriction --- in fact it tries to resize the height of the "browser window" as large as possible (the width is restricted by the "paper size"). This results in a very large window height value for your page, which in turn results in a very large height value for your watermark DIV.
webkit-transform:rotate rotate around the center of the element. This means when your watermark DIV has a very large height, the majority of the DIV area will be rotated outside of the page, only the middle section will remain inside, since the text is at the top of the DIV, it will be rotated out when you have large page height.
A common misconception is the browser's window height is the same as the height of a single PDF page. This is false. For HTML to PDF converter, the "browser window" height is the whole document. This is necessary to render certain pages correctly. For example, some page has a floating toolbar at the bottom of the page. It will make much more sense to render this toolbar at the bottom of the whole document than just render it at the bottom of the first page.
Thanks!
|
Rank: Member Groups: Member
Joined: 10/17/2013 Posts: 22
|
Your advice solved my problem.
Thanks.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Great! Please feel free to let us know if there is anything else.
|