Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26348

    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:
    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.
    <br /> <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br /> "xhtml.dtd"><br /> <!-- modelo --><br /> <!-- documento --><br /> <pd4ml:transform pageFormat="A4" screenWidth="600" pageOrientation="portrait" pageInsets="10,30,20,20,mm"><br /> <html><br /> <head><br /> </head><br /> <body><br /> <!-- PD4ML --><br /> <br /> <pd4ml:page.header scope="1"><br /> <table width="100%"><br /> <tr><br /> <td>Testando cabeçalho 1a pagina</td><br /> </tr><br /> </table><br /> </pd4ml:page.header><br /> <br /> <pd4ml:page.header scope="2+"><br /> <table width="100%" border="0" bgcolor="#FFFFFF"><br /> <tr><br /> <td>Testando cabeçalho 2a pagina</td><br /> </tr><br /> </table><br /> </pd4ml:page.header><br /> <br /> <span style="font-size:11pt"><br /> <!-- Generated by XStandard version 2.0.5.0 on 2010-03-22T14:02:35 --><br /> </span><br /> <p style="font-size:11pt;">a sdf sfsdsd</p><br /> <br /> <pd4ml:page.footer scope="1"><br /> <p>Estou testando meu rodapé 1 </p><br /> </pd4ml:page.footer><br /> <br /> <pd4ml:page.footer scope="2+"><br /> <p>Estou testando meu rodapé 2 </p><br /> </pd4ml:page.footer><br /> </body><br /> </html><br /> </pd4ml:transform><br />
    <br /> StringReader sr = new StringReader(html);<br /> PD4ML pd4ml = new PD4ML();<br /> ByteArrayOutputStream baos = new ByteArrayOutputStream();<br /> //pd4ml.setPageInsetsMM(new Insets(10, 30, 20, 20));<br /> //pd4ml.setHtmlWidth(600);<br /> pd4ml.render(sr, baos);<br />

    #27899

    is a custom JSP tag, which works only in JSP container. Its attributes are mapped to PD4ML API calls. So in .JSP implicitly invokes pd4ml.setPageInsetsMM(new Insets(10, 30, 20, 20));

    If you do not use PD4ML JSP taglib, a call like pd4ml.setPageInsetsMM(new Insets(10, 30, 20, 20)); is the only way to define the margins.

    #27900

    Ok. I was not doing right, for PD4ML works differently from other tools I’ve experimented. Thank you for replying.

    #27901

    so pd4ml:transform doesn’t work if embedded in raw HTML for processing via pd4ml.render(HTMLInputStream, pdfOutputStream);? I’m looking to set up templates with page orientation data in them but have been struggling with getting them to work. I’d prefer to not have to code the Java handler to set the orientation…

    sample HTML:
    <pd4ml:transform pageOrientation="landscape"><br /> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<br /> "http://www.w3.org/TR/html4/loose.dtd"><br /> <html><br /> <head><br /> <title>landscape report - DEV</title><br /> ...

    #27902

    is a custom JSP tag, mapped to PD4ML API.

    Unfortunately the feature you need currently is not supported by PD4ML.

    #27903

    Can I add margins on every page except the first page where the header needs to stick to the top?

Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.