Forum Replies Created

Viewing 15 posts - 1,981 through 1,995 (of 4,243 total)
  • Author
    Posts
  • in reply to: HTML/CSS rendering issues
    #26749

    I’m encountering a bizarre problem when attempting to render a page from HTML supplied to PD4ML in an input stream. The HTML contains various images – some from localhost (with src=”http://localhost/image.jpg” or similar), and some from a remote server. The images from localhost are being included in the PDF output fine, but those from the remote server are not.

    Initially I thought this might be a connection issue, and that network settings and proxy configuration might be responsible for PD4ML being unable to load these images. However, it turns out that PD4ML seems perfectly capable of rendering images from a remote server when those images are on a web page supplied by URL.

    To give an explicit example: when I attempt to render the html “” (the Google logo on the main page) by passing it into the PD4ML.render(InputStreamReader, OutputStream) method, I’m given a blank PDF document. But when I attempt to render the Google homepage by calling PD4ML.render(“http://google.com”, outputStream), the PDF document is rendered fine, including the logo. There’s a minor discrepancy in that the logo on the Google homepage is included as the background of a

    tag, but that turns out to be irrelevant as the same div doesn’t render with a background when passed directly to PD4ML.

    It seems slightly bizarre that PD4ML is able to download images in the one case but not in the other. Are you able to shed any light on why this might be? Thanks.

    in reply to: Images not loading when rendering from input stream
    #29055

    Did you try to enable debug info and to check what it writes to the log/STDOUT by an attempt to load the image (if any attempts at all)?

    in reply to: TTF embedding
    #27302

    what are the license terms for the fonts used in http://pd4ml.com/i/easyfonts/fonts.jar? Can we use that in our commercial web application in which we generate and serve pdf to the users?

    in reply to: TTF embedding
    #27303

    The fonts are taken from a Win32 distribution and published for educational purposes only. If you own a Windows license, obviously you are allowed to use the fonts in your commercial applications. http://pd4ml.com/examples.zip (chinese_ttf example) provides you with fonts.jar build-script to build the JAR from your very own TTF copies.

    in reply to: Underlines get extra spaces
    #29054

    Embedding fonts resolved this issue. Thanks!

    in reply to: HTML/CSS rendering issues
    #26750

    Hi there,

    I’m currently evaluating PD4ML and all going well apart from the following issue. I have extended PD4PageMark to supply different HTML for the first page header/footer from the subsequent pages. For example, each header/footer would be defined by:

    <br /> public class DifferingPageMarker extends PD4PageMark {<br /> <br /> protected String firstPageHtml;<br /> protected String otherPageHtml;<br /> <br /> public DifferingPageMarker(String firstPageHtml, String otherPageHtml) {<br /> super();<br /> this.firstPageHtml = firstPageHtml;<br /> this.otherPageHtml = otherPageHtml;<br /> setAreaHeight(-1);<br /> }<br /> <br /> @Override<br /> public String getHtmlTemplate(int pageNumber) {<br /> if(pageNumber == 1) {<br /> return firstPageHtml;<br /> }<br /> return otherPageHtml;<br /> }<br /> }<br />

    The problem is that the subsequent footer/headers seem to adhere to the first page header/footer heights – so if the first header/footer is large/small, the second header/footer takes up the same space, even if the content is smaller/larger.

    Any help would be appreciated – am I not supplying the height correctly? Should I be doing this in a different way?

    Kind Regards,
    Rob

    in reply to: Anybody had problems with PD4ML on Lion for Mac?
    #28971

    I get an exception with this .jar as follows:
    java.lang.ClassNotFoundException: org.w3c.css.sac.Parser
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
    java.lang.ClassLoader.defineClass1(Native Method)
    java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2331)
    org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:976)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1451)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
    java.lang.Class.forName0(Native Method)
    java.lang.Class.forName(Class.java:169)
    org.zefer.html.doc.PD4MLHtmlParser.o00000(Unknown Source)
    org.zefer.html.doc.PD4MLHtmlParser.(Unknown Source)
    org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.taglib.PD4MLTransformerTag.render(Unknown Source)
    org.zefer.pd4ml.taglib.PD4MLTransformerTag.doEndTag(Unknown Source)
    org.apache.jsp.includedocs.houseInclude.PrintPdf_jsp._jspService(PrintPdf_jsp.java:294)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet._serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)

    in reply to: Anybody had problems with PD4ML on Lion for Mac?
    #28972

    P.S. please forgive my slow replies

    I’ve finally configured email notifications, however, so I can reply quicker,
    though I will be on hols from 14th July

    in reply to: HTML/CSS rendering issues
    #26751

      In the code above, the ul element displays with a margin-left of ~40px, despite having its css style with “margin:0px”. Interestingly, without this style it also displays with a margin-bottom, but this is removable with css styles.

      in reply to: Anybody had problems with PD4ML on Lion for Mac?
      #28973

      Hmm… The exception is expected, but unfortunately does not explain a lot. At least pd4ml.jar and the main CSS parser classes does not clash with Tomcat stuff.

      Well, would it be possible for you to return back the original ss_css2.jar, pack the entire Tomcat directory structure (with previously removed sensitive stuff) including the problematic webapp and send it to us? We’ll try to run your environment on our workstation.

      in reply to: HTML/CSS rendering issues
      #26752

      Hi!

      I came across an issue which I’m not sure if it’s pd4ml or pdf related.

      Below is code html example that contains a div with repeating image as background. Bacground image is semi-transparent (30×60) and is repeated both horizontally and vertically across the div area (300×300). For some reason each repeated backround parts overlap by 1 pixel creating an unwanted grid in the background. With solid backgound this slipped out of sight but as soon as transparent image was used it was noticed.

      <?xml version="1.0" encoding="UTF-8"?><br /> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br /> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:pd4ml="http://pd4ml.com/tlds/pd4ml/2.6" xml:lang="fi" lang="fi"><br /> <head><br /> <title>transparent bg test</title><br /> <style rel="stylesheet" type="text/css"><br /> #d1<br /> {<br /> width: 300px;<br /> height: 300px;<br /> background-image: url("your image url");<br /> background-repeat: repeat;<br /> background-position: left top;<br /> }<br /> </style><br /> </head><br /> <body lang="FI_fi"><br /> <div id="d1"><br /> </div><br /> </body><br /> </html>

      Is this a bug or pdf feature? Tested with 3.8.0fx4

      Thanks in advance!

      Kalle

      in reply to: PDF page headers/footers definition options
      #27274

      I’m trying to insert a footer for only page 1.

      Via API-call this can’t be done, accordering to the reference.

      So, only inline is the only option I see.

      This is my code:

      52008
      20090001


      This part seems to be just ignorred. (page.header does work this way).

      Is this a bug, or am I doing something wrong?

      in reply to: PDF page headers/footers definition options
      #27275

      replace areaHeight=”100″ with height=”100″ – it should help if you use PD4ML Pro (not Std)

      #29056

      You are faced with a limitation of header/footer API of PD4ML. If you need different header or footer heights depending on page, you have to use inline definitions and

      See http://pd4ml.com/cookbook/pdf_header_footer_generation.htm

      in reply to: HTML/CSS rendering issues
      #26753

      I have a Struts 2 “property” tag in my page.
      When the property value contains an html entity, that value is written literally in the resulting pdf.

      Example:

      will print “'” in the page.

      In the real application, the value is read from an action, of course.
      How can I solve this problem?

      Thank you

    Viewing 15 posts - 1,981 through 1,995 (of 4,243 total)