PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Problem in applying margins
   PostPosted: 22 Mar 2010, 19:14 
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);


  Subject: Re: Problem in applying margins
   PostPosted: 22 Mar 2010, 19:21 
<pd4ml:transform> is a custom JSP tag, which works only in JSP container. Its attributes are mapped to PD4ML API calls. So in .JSP <pd4ml:transform pageFormat="A4" screenWidth="600" pageOrientation="portrait" pageInsets="10,30,20,20,mm"> 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.


  Subject: Re: Problem in applying margins
   PostPosted: 23 Mar 2010, 15:52 
Ok. I was not doing right, for PD4ML works differently from other tools I've experimented. Thank you for replying.


  Subject: Re: Problem in applying margins
   PostPosted: 29 Apr 2010, 23:52 
so pd4ml:transform doesn't work if embedded in raw HTML for processing via
Code:
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:
Code:
<pd4ml:transform pageOrientation="landscape">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>landscape report - DEV</title>
...


  Subject: Re: Problem in applying margins
   PostPosted: 21 May 2010, 09:31 
<pd4ml:transform> is a custom JSP tag, mapped to PD4ML API.

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


  Subject: Re: Problem in applying margins
   PostPosted: 16 Jun 2017, 18:19 
Can I add margins on every page except the first page where the header needs to stick to the top?



[Reply]     [ 6 posts ] 

Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share