Welcome Guest Search | Active Topics | Sign In | Register

HTML Watermark is located out of the PDF page boundaries. Options
Joseph Malka
Posted: Monday, September 15, 2014 10:17:21 AM
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
eo_support
Posted: Monday, September 15, 2014 10:51:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
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.aspx

Once 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.aspx

Hope this helps.

Thanks!
eo_support
Posted: Tuesday, September 16, 2014 11:17:47 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
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!
Joseph Malka
Posted: Wednesday, September 17, 2014 6:00:00 AM
Rank: Member
Groups: Member

Joined: 10/17/2013
Posts: 22
Your advice solved my problem.

Thanks.
eo_support
Posted: Wednesday, September 17, 2014 8:38:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Great! 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.