Hi. I'm testing PD4ML trial v360. One of the problems I'm having is that the page insets defined by the tag pd4ml:transform do not work. The margins I define are only applied to the PDF when I add the following line to the Java code:
Code:
pd4ml.setPageInsetsMM(new Insets(10, 30, 20, 20));
Does anybody have an idea why this could be happening? Below are both my html and my Java code. Thanks.
Code:
<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"xhtml.dtd">
<!-- modelo -->
<!-- documento -->
<pd4ml:transform pageFormat="A4" screenWidth="600" pageOrientation="portrait" pageInsets="10,30,20,20,mm">
<html>
<head>
</head>
<body>
<!-- PD4ML -->
<pd4ml:page.header scope="1">
<table width="100%">
<tr>
<td>Testando cabeçalho 1a pagina</td>
</tr>
</table>
</pd4ml:page.header>
<pd4ml:page.header scope="2+">
<table width="100%" border="0" bgcolor="#FFFFFF">
<tr>
<td>Testando cabeçalho 2a pagina</td>
</tr>
</table>
</pd4ml:page.header>
<span style="font-size:11pt">
<!-- Generated by XStandard version 2.0.5.0 on 2010-03-22T14:02:35 -->
</span>
<p style="font-size:11pt;">a sdf sfsdsd</p>
<pd4ml:page.footer scope="1">
<p>Estou testando meu rodapé 1 </p>
</pd4ml:page.footer>
<pd4ml:page.footer scope="2+">
<p>Estou testando meu rodapé 2 </p>
</pd4ml:page.footer>
</body>
</html>
</pd4ml:transform>
Code:
StringReader sr = new StringReader(html);
PD4ML pd4ml = new PD4ML();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
//pd4ml.setPageInsetsMM(new Insets(10, 30, 20, 20));
//pd4ml.setHtmlWidth(600);
pd4ml.render(sr, baos);