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

    Hi there,

    I dropped down PD4ml to evaluate today for my company for a project we are doing. I am converting an HTML page generated by xsl and everything is working brilliantly. However, I have one issue. I can not get images to render in the PDF.

    all I get during the render is:

    image not yet in cache:
    not yet in cache:
    Connection timed out: connect:

    If you paste the url into any browser you will see it appears instantly, I tried on another random image from the web and go the same problem. I wonder if you can point me in the right direction.

    The code I am using to generate is:
    PD4ML html = new PD4ML();
    html.setPageSize(new java.awt.Dimension(450, 450));
    html.setPageInsets(new java.awt.Insets(20, 50, 10, 10));

    response.setHeader(“Content-disposition”, “inline; filename=test4.pdf”);
    if (!request.isSecure()) {
    response.setHeader(“Pragma”, “no-cache”);
    response.setHeader(“Expires”, “-10000”);

    URL base = new URL(“file:E:\temp\testarrr.jsp”);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    html.render(url, baos);

    byte[] result = baos.toByteArray();

    ServletOutputStream sos = response.getOutputStream();


    I forgot to mention, these images are not the same site as the PDF is being generated. They are being delivered by a different one.


    Typical reasons of the issue could be like that:

    there are 3 nodes in the scenario: client browser (A), document/PD4ML server (B), images server (C).

    In regular web browsing scenario A establishes a connection to B to download HTML, and after that to C to download the images.
    A – B
    A – C

    In PD4ML scenario A only establishes a connection to B (to get PDF). In order to produce PDF B connects to C itself to load images.
    A – B
    B – C

    As a rule A has all needed routing info and “knows” how to connect to B and to C even if there is a firewall/reverse-proxy in-between.

    But very often server (B) does not know how to resolve name of image server (C), especially if the name is defined for outside world like, but within intranet it is known under a paranoid cryptic name i.e.; or when the C is belong to another net, and due to security policy B has no routing to C.


    ahh I see-

    In case anyone else has the problem, I have gotten around it by putting the full unc path to the server which servers up the images. Example:

    that has sorted out the issue and the images are rendered.



    I guess I’m having a somewhat similar problem, however my images are coming not from an intranet server, but from an Amazon S3 account. Something like:

    Is it possible to embed images into the PDF from Amazon S3, or will they need to be accessed from the server generating the PDF?



    Your server must be able to establish a TCP/IP connection to… (probably you’ll need to route HTTP(S) requests from the server via proxy).

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

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.