Forum Replies Created

Viewing 15 posts - 3,436 through 3,450 (of 4,234 total)
  • Author
    Posts
  • in reply to: Generated pdf with watermark file size is too big
    #30020

    Hi,
    unfortunately this happens even for JPEGs.

    I could provide examples, but i have no idea how to attach files here.

    in reply to: HTML/CSS rendering issues
    #27150

    Hallo,

    I’m having problems using a div with ‘position: absolute’ inside an other div with ‘position: relative’ in combination with ‘page-break-inside: avoid’. The relative divs are positioned as is expected. But the absolute positioned divs are rendered like they would be with out the page break.

    Example code:
    <br /> <%<br /> for ( int i = 0; i < 10; i++ ) {<br /> %><br /> <table><br /> <tr style="page-break-inside: avoid"><br /> <td><br /> <div style="position: relative; width: 400px; height: 400px; border: solid 2px red;"><br /> Outer div: <%=i%><br /> <div style="position: absolute; left: 100px; top: 100px; width: 200px; height: 200px; border: solid 2px green;"><br /> Inner div: <%=i%><br /> </div><br /> </div><br /> </td><br /> </tr><br /> </table><br /> <%<br /> }<br /> %><br />

    See screenshot of generated output. The green divs should always be in the exact center of the red divs, but this is not the case.

    Does anybody have an idea how to fix this problem?

    in reply to: Generated pdf with watermark file size is too big
    #30021

    Sorry for the confusing hint. My fault. Even if you use JPEG, it still adds a transparency info for watermarking and converts the image to a gzipped sequence of pixel colors (which can result the image data become huge if the image dimensions are big).

    Would it be a solution for you to define page background image instead of a watermark? There is setPageBackgroundImageUrl() API call for that.

    #30061

    A page breaking logic for absolute positioned elements was too browser-specific the time we added it to PD4ML. So we implemented two (reasonable from our perspective) modes. There were also strange approaches: i.e. the absolute positioned elements are rendered only on the first page. We did not support that.

    So try the alternative mode:

    [language=java:1w2yzs33]Map m = new HashMap();
    m.put(PD4Constants.PD4ML_ABSOLUTE_ADDRESS_SPACE, “document”);
    pd4ml.setDynamicParams(m);[/language:1w2yzs33]

    Or switch the mode on by the JVM param:
    -Dpd4ml.absolute.address.space=document

    in reply to: pd4ml.useTTF() create (but not delete) temporary files
    #29521

    I can confirm this problem as well.
    PD4ML generates a lot of temporary files (+~JF*.tmp) because of fonts and there isn’t a cleanup procedure. They just stay in the temp folder.

    in reply to: pd4ml.useTTF() create (but not delete) temporary files
    #29522

    The temp files are implicitly created by JVM after each createFont(int, InputStream) call. After a font object is garbage collected, for some strange reason JVM does not delete its temp file. They are collectively deleted after JVM quits, but some of them are forgotten and remain in the temp directory until the host OS cleans up. We have found no way to force JVM to cleanup font temp files.

    The recent PD4ML versions try to workaround the issue by a copying of needed font files to TEMP dir and pointing to them with createFont(int, File) API call. In the case JVM does not create extra .TMP files by its own.

    Which PD4ML version do you use?

    in reply to: Fit image bu width or height
    #29672

    Are relative widths already supported?
    Is max-width: 100% on images in css supported?

    img { max-width: 100%} doesn’t seem to work

    in reply to: page-break-inside: avoid Not Working
    #27558

    ‘Page-break-inside: avoid’ on a div, written in the css, doesn’t seem to work. Is it not yet supported?

    in reply to: Problem in applying margins
    #27903

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

    in reply to: Troubleshooting
    #26392

    I use Pd4ML tag library which in fact has the first few lines as
    <br /> <%@ taglib uri="http://pd4ml.com/tlds/pd4ml/2.6" prefix="pd4ml"<br /> %><%@page contentType="text/html; charset=ISO8859_1"<br /> %><pd4ml:transform<br />

    I am wondering if the contentType should be “application/pdf” instead ??
    A http request hits on one of our controllers which sends the response as a JSP that uses PD4ML.
    But the problem is the response is received as (content type) application/octet-stream because of which the PDF does not render. Is there a way to fix this? or is there a way in PD4ML tag library to set content type elsewhere in one of the tags?

    Thanks for your help. I appreciate.

    in reply to: response content type
    #28031

    Never mind. I have got this working 🙂

    in reply to: Troubleshooting
    #27155

    I wanted to use tag to prevent printing, modifying, saving etc and for some reason it is not working.
    In particular, I wanted to prevent saving the PDF created.

    My code was like
    <br /> <pd4ml:permissions<br /> password="empty"<br /> rights="-2581"<br /> strongEncryption="false" /><br />

    I got rights = -2581 after computing
    0xffffffff ^ PD4Constants.AllowCopy ^ PD4Constants.AllowContentExtraction ^ PD4Constants.AllowPrint<br /> which gave -2581

    Do you guys find why it’s not working as expected?
    Is ‘PD4Constants.AllowCopy’ same as saving the PDF?
    What would be the correct “rights” integer value to preventing the PDF to be saved?

    Thanks a lot for your pointers and help. I appreciate.

    in reply to: General questions / FAQ
    #27156

    Hi All,

    Large Images when taken from iPhone is not rendered fully when converting to PDF. i have gone through the API documentation but could not find any way to dynamically assign the PageSize depending on the size of the image.

    PageSize = PD4Constants.A4

    Kindly assist if theres a way to dynamically assign the pagesize depending on the image size.

    Thanks,
    Rakesh

    in reply to: Issues rendering Large Images from iPhone
    #30074

    With pageSize you specify target document (paper) format.
    With htmlWidth you define “virtual HTML browser” frame width to be mapped to the chosen paper Format width.

    So if your images are cut right side, try to increase htmlWidth parameter correspondingly (to scale down the content).

    If the image width is not known, there is a handy pd4ml.adjustHtmlWidth() API call (but in the case a document scale will depend on the content, which is not always desired)

    in reply to: HTML/CSS rendering issues
    #27149

    Hi,

    We are currently using Arialuni.ttf for rendering chinese characters however from time to time we are getting rendering issues for the chinese and is defaulting to (?) question mark.

    I suspect that as the Arialuni.ttf is 20MB it is taking some overhead on the rendering and causing failures.

    is there a way to optimize this approach?

    here is our properties file which we use to embed the TTF:
    Arial=arialuni.ttf
    Serif=arialuni.ttf
    Times New Roman=arialuni.ttf
    SimSun=arialuni.ttf

    Any advise would be much appreciated

Viewing 15 posts - 3,436 through 3,450 (of 4,234 total)