Hi, I'm evaluating Prince for a project I'm working on. I have the trial implemented through PHP, HTML string to PDF method.
The document I'm converting is a list of pages, and each element is absolute positioned inside each page. When I view the HTML output the elements are positioned as they should be, when I run it through Prince the elements start from the top left corner, and run vertically down the page in a list.
Each page div has an explicit width/height in pixels, is there a way to reference the actual page size vs. pixel equivalents? Or is this safe?
Each element has a style tag, with its top and left set to it's position, but both values seem to be ignored?
Here's an example of the HTML:
Any ideas on why it's not working as expected?
The document I'm converting is a list of pages, and each element is absolute positioned inside each page. When I view the HTML output the elements are positioned as they should be, when I run it through Prince the elements start from the top left corner, and run vertically down the page in a list.
Each page div has an explicit width/height in pixels, is there a way to reference the actual page size vs. pixel equivalents? Or is this safe?
Each element has a style tag, with its top and left set to it's position, but both values seem to be ignored?
Here's an example of the HTML:
<html>
<head>
<title>Tim's Proposal</title>
<link href="/assets/css/pp.export.css" type="text/css" rel="stylesheet" media="all" />
<style type="text/css">
@page {
size: US-Letter portrait;
margin:0 0 0 0;
}
.page-size {
position:relative;
width:816px;
height:1056px;
outline:1px solid black;
}
.ppUserStyle23 {
font-family:Georgia;
font-size:14px;
line-height:12px;
color:#a10da1;
text-align:left;
}
.ppUserStyle22 {
font-family:Verdana;
font-size:10px;
line-height:12px;
color:#000000;
text-align:left;
}
</style>
</head>
<body>
<div class="proposal-pages">
<div class="proposal-page page-size">
<div class="textbox" style="width:237px;height:143px;top:27px;left:19px;z-index:500px;">This is some other text.<br></div>
</div>
<div class="proposal-page page-size">
<div class="textbox" style="width:237px;height:143px;top:27px;left:19px;z-index:500px;">This is some other text.<br></div>
</div>
<div class="proposal-page page-size">
<div class="textbox" style="width:217px;height:177px;top:60px;left:86px;z-index:500px;"><span class="ppUserStyle23">This is some text.</span><br><br><span class="ppUserStyle23 ppUserStyle22">This is some other text.</span><br><br><span class="ppUserStyle23">This is another text.</span><br></div>
<img src="http://jonathan.pitchperfectapp.com/uploads/images_library/placeholder1.jpg" class="image" style="width:98px;height:138px;top:369px;left:489px;z-index:500px;" />
<img src="http://jonathan.pitchperfectapp.com/uploads/images_library/placeholder1.jpg" class="image" style="width:191px;height:269px;top:45px;left:457px;z-index:500px;border:5px solid #db83db;border-radius:10px;" />
</div>
<div class="proposal-page page-size">
<div class="textbox" style="width:217px;height:177px;top:60px;left:86px;z-index:500px;"><span class="ppUserStyle23">This is some text.</span><br><br><span class="ppUserStyle23 ppUserStyle22">This is some other text.</span><br><br><span class="ppUserStyle23">This is another text.</span><br></div>
<img src="http://jonathan.pitchperfectapp.com/uploads/images_library/placeholder1.jpg" class="image" style="width:98px;height:138px;top:369px;left:489px;z-index:500px;" />
<img src="http://jonathan.pitchperfectapp.com/uploads/images_library/placeholder1.jpg" class="image" style="width:191px;height:269px;top:45px;left:457px;z-index:500px;border:5px solid #db83db;border-radius:10px;" />
</div>
</div>
</body>
</html>
Any ideas on why it's not working as expected?