Forum Replies Created

Viewing 15 posts - 2,446 through 2,460 (of 4,249 total)
  • Author
    Posts
  • in reply to: Landscape and portrait on the same document
    #28629

    Unfortunately there is no out-of-the-box solution for the issue. As a workaround you may define all page insets 10mm, and add extra 20mm using HTML/CSS means (i.e. margin-left or margin-top) where needed.

    in reply to: General questions / FAQ
    #26862

    Hey PD4ML,
    Would it be possible to make the the irreversible methods on the PD4ML class reversible? For example, the following methods all cannot be undone:
    disableHyperlinks()
    enableDebugInfo()
    fitPageVertically()
    adjustHtmlWidth()

    Many times, I use one PD4ML instance to render several documents, and these are fields that i would like to switch on and off during use. Instead, I have to completely re-create a new PD4ML instance every time I want to undo one of these changes. Would this be easy to make happen in an upcoming release?

    in reply to: Request to make irreversible pd4ml methods reversible
    #29377

    We recommend to create a new instance of PD4ML class for each conversion request. A class creation overhead can be ignored (comparing to massive resource consuming by HTML rendering). Usually that helps to prevent many difficult-to-detect problems like simultaneous access to the same PD4ML instance from multiple threads.

    With a new instance there is no need to perform reverse API calls – you just do not trigger methods you do not need.

    But you are right – from some point of view the actual API is not fully consistent. We plan to review it in new PD4ML generation (as well as to sacrifice some legacy features).

    in reply to: Troubleshooting
    #26863

    When my CSS file contains this comment, …
    /*===*/
    PD4ML reports an error and ignores the entire CSS file in the HTML-to-PDF conversion.

    I turned on debug info, and I see the following output and error in my debugger console. Why is PD4ML removing the initial “*” in the comment? The original CSS file does contain the “*”.

    It looks like PD4ML has a comment parsing problem. What do you think?

    I am using PD4ML 385 Pro (eval).

    Console output …
    <br /> /== LAYOUT ==*/<br /> td.layoutCellSimplified{<br /> vertical-align: top;<br /> }<br /> <br /> /== HEADER ==*/<br /> .contentReportTitle.headerText{<br /> font-size: 13px;<br /> }<br /> <br /> ... LOTS OF CSS LINES ...<br /> <br /> org.w3c.css.sac.CSSException: Encountered "/" at line 1, column 1.<br /> Was expecting one of:<br /> <EOF><br /> <S> ...<br /> "." ...<br /> ":" ...<br /> "*" ...<br /> "[" ...<br /> "::" ...<br /> <HASH> ...<br /> "<!--" ...<br /> "-->" ...<br /> "@import" ...<br /> "@page" ...<br /> "@media" ...<br /> "@font-face" ...<br /> "@charset" ...<br /> <ATKEYWORD> ...<br /> <IDENT> ...<br /> <br /> at com.steadystate.css.parser.SACParser.parseStyleSheet(SACParser.java:60)<br /> at org.zefer.html.doc.css.d.new(Unknown Source)<br /> at org.zefer.html.doc.css.c.o00000(Unknown Source)<br /> at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.myOrg.myCode.PDFConverter.doConvert(PDFConverter.java:289)<br />

    in reply to: CSS comment "/*===*/" causes error
    #29380

    It seems to be something wrong with the third-party CSS Parser project library (ss_css2.jar). We’ll check if ss_css2.jar can be fixed with reasonable efforts.

    in reply to: Request to make irreversible pd4ml methods reversible
    #29378

    Any decent Java developer knows that using thread-unsafe methods on an instance from multiple threads will lead to inconsistent behavior. In this case, it makes sense to instantiate a new instance, and I think developers know this already. It just comes with the territory of parallel programming.

    However, why would you intentionally design the API around the parallel use case when the serial use case is just as valid and probably used just as often? For instance, if the developer wants to set up a PD4ML instance with the same options and footers and headers for a large batch of documents that they plan to render in serial, why would you have them instantiate a new PD4ML object and set these options every time? That’s unnecessary and time consuming.

    I appreciate that you’re reviewing your API and making it consistent. I’m just requesting that the API be considered from several use cases. Not just the most complicated one.

    in reply to: Troubleshooting
    #26864

    Hello,

    I have a configuration question/issue that I was curious if you could help me out with. I’m currently looking at the latest version of PD4ML 3.85 and experimenting with table breaks.

    Issue
    In the attached PDF on pages 12 – 13, if a table is small enough to fit on the next page, but not big enough to fit on the current page then PD4ML moves the entire table to the next page. This leaves a huge blank area sometimes more than half a page long.

    Why is this? Maybe its a configuration setting. I currently am using enableSmartTableBreaks and have TR, TABLE {page-break-inside: avoid;} in my HTML CSS. Is there any settings I could adjust?

    I’ve tried turning off Smart Table Breaks, but then it splits right in the middle of rows/cells and looks very ugly.

    I’m using the Java version. Here is my configuration on the Java Side:
    PD4ML html = new PD4ML();
    html.setPageSize(PD4Constants.LETTER);
    html.setPageInsets(new Insets(25,25,25,25));
    html.enableImgSplit(false);
    html.setHtmlWidth(1024);
    html.enableSmartTableBreaks(true);
    html.setPageSize(html.changePageOrientation(PD4Constants.LETTER));
    html.generateOutlines(true);

    Where it is correct
    You will notice on pages 4-6 if a table is to large to fit on the next page alone then it moves the entire table up to where it should be a breaks it appropriately.

    Finally, on page 9, if the table can fit on the proper page then it is placed appropriately as well.

    Thank for all the help anyone can offer.
    Matt

    in reply to: HTML/CSS rendering issues
    #26865

    pd4ml 3.8.5b8 embedded jar
    Windows 7 64 bit
    java 1.6.0_38

    When rendering an RTF from Html that has a brace character in it, you’re not escaping the brace characters. This results in an RTF file that has unmatched braces and cannot be opened by the most-often used editors for RTF viewing.

    From the RTF spec:

    As previously mentioned, the backslash () and braces ({ }) have special meaning in RTF. To use these characters as text, precede them with a backslash, as in \, {, and }.

    Html Example:
    <br /> <html><br /> <head/><br /> <body><br /> <div>{Belleville Toyota, Inc. v. Toyota Motor Sales, U.S.A., Inc.</div>,<br /> </body><br /> </html><br />

    Results in:
    <br /> {rtf1<br /> {info<br /> {title }<br /> }<br /> paperw11900paperh16840headery500footery500margl1104margr604margt604margb604widowctrlf1i0b0fs16{fonttbl{f1 Arial Unicode MS;}<br /> }<br /> {colortbl;red0green0blue0;<br /> }<br /> {widctlparcf1 {Belleville Toyota, Inc. v. Toyota Motor Sales, U.S.A., Inc.<br /> par}cf1f1i0b0fs20 , }<br />

    This is an invalid RTF file (cannot be opened by Microsoft Word).
    WordPad must be more lenient and add braces at the end, but regardless, the file violates the RTF spec.

    in reply to: Html with brace characters {} rendering invalid RTF
    #29381

    We just fixed the issue in the development build. A fix will be available with the forthcoming beta release in about 1 week.

    in reply to: TOC More Parameters / Inject CSS classes in TOC
    #29280

    Hi,

    Should i just include tag in my html to support TOC or should i define a stylesheet as well.

    Please let me know this it will be of great help thanks

    in reply to: Convert URL to image in java applet
    #29112

    Hi,
    I am almost a green hand on image converting program in java applet, because I have worked with .net for years. As for myself, I’d like to use a fine 3rd party image conversion SDK whose way of processing is simple and fast when I need to do with
    the conversion program.It saves a lot of time for me. It is just one of many but I do appreciate its simple way of processing. Even though I only tried its free trial package to convert an URL to an image and didn′t check the cost and licensing conditions, it worked great for me. Besides, this site also gives a lot of conversion tutorials about how to convert document image using C#.NET. Share with you. And I am glad to see that your problem had been solved in time. Good luck.

    Best regards,
    Arron

    in reply to: TOC More Parameters / Inject CSS classes in TOC
    #29281

    Normally you don’t need/can’t use a CSS class for the TOC – this was a rather special Case.

    in reply to: TOC More Parameters / Inject CSS classes in TOC
    #29282

    Right, in most of the cases you would only need to add tag where you want to see a table of contents. CSS style is for a “fine tuning”.

    in reply to: General questions / FAQ
    #26866

    Hello,

    I have a configuration question/issue that I was curious if you could help me out with. I’m currently looking at the latest version of PD4ML 3.85 and experimenting with table breaks.

    Issue
    In the attached PDF on pages 12 – 13, if a table is small enough to fit on the next page, but not big enough to fit on the current page then PD4ML moves the entire table to the next page. This leaves a huge blank area sometimes more than half a page long.

    Why is this? Maybe its a configuration setting. I currently am using enableSmartTableBreaks and have TR, TABLE {page-break-inside: avoid;} in my HTML CSS. Is there any settings I could adjust?

    I’ve tried turning off Smart Table Breaks, but then it splits right in the middle of rows/cells and looks very ugly.

    I’m using the Java version. Here is my configuration on the Java Side:
    PD4ML html = new PD4ML();
    html.setPageSize(PD4Constants.LETTER);
    html.setPageInsets(new Insets(25,25,25,25));
    html.enableImgSplit(false);
    html.setHtmlWidth(1024);
    html.enableSmartTableBreaks(true);
    html.setPageSize(html.changePageOrientation(PD4Constants.LETTER));
    html.generateOutlines(true);

    Where it is correct
    You will notice on pages 4-6 if a table is to large to fit on the next page alone then it moves the entire table up to where it should be a breaks it appropriately.

    Finally, on page 9, if the table can fit on the proper page then it is placed appropriately as well.

    Thank for all the help anyone can offer.
    Matt

    in reply to: Troubleshooting
    #26867

    Here is the sample HTML content which is failing to convert to PDF.

    <br /> <!doctype html><br /> <html><br /> <head><br /> <title>Test</title><br /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><br /> </head><br /> <body><br /> <h3>Test</h3><br /> </body><br /> </html><br />
    Here is the exception what I see on the server.

    java.lang.NullPointerException
    at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
    at org.zefer.pd4ml.PD4ML.render(Unknown Source)
    at com.skire.common.util.PDFUtils.convertToPDF(PDFUtils.java:140)
    at com.skire.common.util.PDFUtils.convertToPDF(PDFUtils.java:38)
    at com.skire.common.taskdefs.PDFTask.webPDF(PDFTask.java:120)
    at com.skire.common.taskdefs.PDFTask.execute(PDFTask.java:57)
    at com.skire.webant.WebTask.perform(WebTask.java:93)

    On commenting meta tag the PDF generation goes through well.
    Any help will be appreciated much.

    Thank you,
    Udaya

Viewing 15 posts - 2,446 through 2,460 (of 4,249 total)