Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #26434

    Hi,

    we are using the pd4ml to convert htmls to pdf files and we have got the images located in a url:
    https://www.xxx.xxx.com/xxxx/images/xaxis.gif

    We are seeing in our logs the following error…
    image not yet in cache: https://www.xxx.xxx/ecomp/images/xxxxxx.gif
    not yet in cache: https://www.xxx.xxx/ecomp/images/xxxxxxxx.gif
    image size: 2733
    image not yet in cache: https://www.xxx.xxx/ecomp/images/xxxxx.gif
    not yet in cache: https://www.xxx.xxx/ecomp/images/xxxxx.gif
    image size: 164
    image not yet in cache: https://www.xxx.xxx/product/dlwimages/mail.gif
    not yet in cache: https://www.xxx.xxx/product/dlwimages/mail.gif
    image size: 248
    image not yet in cache: https://www.xxx.xxx/ecomp/images/xaxis.gif
    not yet in cache: https://www.xxx.xxx/ecomp/images/yaxis.gif
    image size: 155
    image size: 43
    image not yet in cache: https://www.xxx.xxx/product/dlwimages/printer1.gif
    not yet in cache: https://www.xxx.xxx/product/dlwimages/printer1.gif
    image not yet in cache: https://www.xxx.xxx/ecomp/images/xxx_print.gif
    not yet in cache: https://www.xxx.xxx/ecomp/images/xxx_print.gif

    Is there any issue with the https urls?

    Thanks
    Chandra

    #28157

    I forgot to say that, the images are getting displayed in the generated PDF file. But the console output says that the image is “not yet in cache”.

    What is the reson for this and how to eliminate this in our logs?

    #28158

    The log messages seems to be confusing.

    As long as there is nothing like “cannot load image” in the log – it loads the images and places them to the cache successfully.

    You can suppress the output if you switch PD4ML debug mode off.

    #28159

    Thanks for the reply.

    Ya, I commneted “pd4ml.enableDebugInfo();” in my code; And the log is clean.

    My question – the images are seen in the PDF but the log says not yet in cache when I enable debugging…?

    #28160

    It is not a warning, it is not an error. It simply tells that the images are not in cache, so PD4ML loads them from the given URLs and saves to the cache.

    You may create a simple HTML with a non-existent image URL and you’ll see how it reports problems with an image loading.

    #28161

    I have given a non-existent url and I still get that those comments that ‘image not yet in cache’, ‘not yet in cache’.
    However, it clearly says that it cannot load the image and the reource/image not found.

    Log output:
    image not yet in cache: https://www.xxx1.com/xxxxxx/dlwimages/mail.gif
    not yet in cache: https://www.xxx1.com/xxxxxx/dlwimages/mail.gif
    resource https://www.xxx1.com/xxxxxx/dlwimages/mail.gif not found.
    image https://www.xxx1.com/xxxxxx/dlwimages/mail.gif not found.
    can not load image: /xxxxxx/dlwimages/mail.gif
    image not yet in cache: https://www.xxx1.com/xxxxxx/dlwimages/spacer.gif
    not yet in cache: https://www.xxx1.com/xxxxxx/dlwimages/spacer.gif
    resource https://www.xxx1.com/xxxxxx/dlwimages/spacer.gif not found.
    image https://www.xxx1.com/xxxxxx/dlwimages/spacer.gif not found.
    can not load image: /xxxxxx/dlwimages/spacer.gif

    Thanks
    Chandra

    #28162

    I am getting confused by this log output.

    If I convert the html for the first tiime, according to your previous reply, PD4ML is just saying that “the image is not yet in cache” and it will load the image. I am not getting the “cannot load the image” error. This is fine. I assume that the image is now loaded into the cache.

    But when I run the converter again to convert the same HTML with same images, I am still getting the same output in the log that the image is not in cache… 🙁

    This is what my concern is – Whether PD4ML is loading the image and caching it for the first time if I enable the property::::: “pd4ml.cache.enable=true”???
    Whether caching is properly getting implemented here???

    Thanks
    Chandra

    #28163

    > when I run the converter again

    Do you start JVM again?

    #28164

    I am just executing the compiled java class again…

    #28165

    PD4ML cache is a static hash table with soft references to loaded objects. After JVM is stopped, the cache, of course, disappears. Also a shortage or heap space may cause a cache reset.

    I would recommend you to ignore the debug output and to focus on the resulting documents. If there are no missing images and external styles are applied correctly – there are no reasons for a panic.

    #28166

    Hi,

    I’m having the same issue here and I’m not restarting the JVM.
    Code is very simple, maybe cache is not reused if different PD4ML objects are created?

    public static void convert(String html, ByteArrayOutputStream baos, ServletContext servletContext, String baseUrl)
    throws InvalidParameterException, IOException {
    try {
    if (html != null && html.length() > 0) {
    PD4ML pd4ml = new PD4ML();

    pd4ml.enableDebugInfo();

    pd4ml.setPageSize(LANDSCAPE_VALUE ? pd4ml.changePageOrientation(FORMAT) : FORMAT);

    if (“mm”.equals(UNITS_VALUE)) {
    pd4ml.setPageInsetsMM(new Insets(TOP_VALUE, LEFT_VALUE, BOTTOM_VALUE, RIGHT_VALUE));
    } else {
    pd4ml.setPageInsets(new Insets(TOP_VALUE, LEFT_VALUE, BOTTOM_VALUE, RIGHT_VALUE));
    }

    pd4ml.setHtmlWidth(USER_SPACE_WIDTH);
    pd4ml.render(new StringReader(html), baos, new java.net.URL(baseUrl));
    }
    } catch (InvalidParameterException e) {
    logger.error(“Error rendering PDF”, e);
    } catch (IOException e) {
    logger.error(“Error rendering PDF”, e);
    }
    }

    Thanks,

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

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