Forum Replies Created

Viewing 15 posts - 3,361 through 3,375 (of 4,243 total)
  • Author
    Posts
  • in reply to: General questions / FAQ
    #27126

    Hello PD4ML team,

    Could you please enable “enableSmartTableBreaks” for RTF?
    We tried that option in 399fx1 (pro) and it looks like it does not work. The API doc says it is for PDF. We have requirement to generate both: PDF and RTF and while some minor differences are acceptable – this one – table header on every page – is quite important (our table can span over tens of pages).

    in reply to: HTML/CSS rendering issues
    #27128

    By using pd4ml, I have converted the html to pdf.

    Page orientation used is “Landscape” and paper size used is “LETTER”.

    The issue is the right side margin and the content from right side margin for few points are missing. Please refer the attachment.

    How to dynamically wrap the content of the document inside the margin without changing the HTML content.

    Please suggest for any code snippet that can be used my java class.
    Is it possible to do so ? Please advise.

    in reply to: pdf’s Table right margin and the content is missing
    #29991

    The table is wider than htmlWidth conversion parameter, so it does not fit a frame of a virtual HTML renderer.

    Just increase the param.

    But take into account: htmlWidth value impacts content scaling factor.

    in reply to: General questions / FAQ
    #27129

    Hi All, I am new to pd4ml and have a requirement to configure duplex printing for the PDF documents that will be generated using PD4ml.

    Use case is as follow:

    – User can select 1 or many HTML fragments (templates) for PDF creation
    – While creating PDF user can identify if duplex (double side) printing is required.
    – If user selects for duplex printing, the generated PDF (combination of all the HTML files should support duplex printing e.g. after first HTML the next HTML should go to next page, so that when printing happens the second HTML fragment starts from new page)

    I have browsed online help and found PD4ML defines special versions of render() methods, which accept multiple HTML documents for a conversion into a single PDF: render(URL[],…) and render(StringReader[],…). The approach will give you more predictable result (as there is no CSS style inter-mixes, could happen by document merge), but has a limitation: each source HTML document starts a new PDF page; there is no way to continue half-blank page with a new doc.

    Does anyone has working Java example?

    in reply to: pdf’s Table right margin and the content is missing
    #29992

    We are using an application which automatically creates the html, based on the inputs we provide(same as the message body(text area) where we post a reply/query to any forum. for example the same pd4ml support forum page).Which is a standard functionality of that particular application.

    we are converting this auto generated html to pdf. So we can only work with the java code for this auto adjustment of the content of pdf document to fit to html width.
    we are facing this right margin and some content from right margin missing issue,specifically when the content of the html includes tables and multi level bulleted list.

    Can i auto adjust the table width to automatically adjust according to the html width?
    is there any java code phrase available for,auto page break option, when the text exceeds the html width limit?

    in reply to: pdf’s Table right margin and the content is missing
    #29999

    We are using an application which automatically creates the html, based on the inputs we provide(same as the message body(text area) where we post a reply/query to any forum. for example the same pd4ml support forum page).Which is a standard functionality of that particular application.

    we are converting this auto generated html to pdf. So we can only work with the java code for this auto adjustment of the content of pdf document to fit to html width.
    we are facing this right margin and some content from right margin missing issue,specifically when the content of the html includes tables and multi level bulleted list.

    Can i auto adjust the table width to automatically adjust according to the html width?
    is there any java code phrase available for,auto page break option, when the text exceeds the html width limit?

    in reply to: HTML/CSS rendering issues
    #27130

    I am trying to embed Archer fonts using Java API. The html version of my page works well with the fonts, but when I try to render that url using PD4ML, it gives an error in my console:

    file:/windows/fonts/Archer-Book_1.otf does not seem to be TTF

    I tried renaming to .ttf, and it still says Archer-Book_1.ttf does not seem to be TTF

    Code to get PD4ML instance:
    private static PD4ML getPd4mlInstance(PdfGeneratorSettings settings,<br /> HttpSession httpSession) {<br /> PD4ML pd4ml = new PD4ML();<br /> String httpSessionId = httpSession.getId();<br /> pd4ml.setCookie(SESSION_KEY,<br /> httpSessionId + PATH);<br /> pd4ml.setPageSize(getPageSizeAndOrientation(pd4ml,<br /> settings));<br /> pd4ml.setHtmlWidth(settings.getHtmlPageWidth());<br /> pd4ml.setPageInsets(settings.getPageInsets());<br /> try{<br /> pd4ml.useTTF("/windows/fonts", true);<br /> } catch (FileNotFoundException e){<br /> LOG.error("not able to find fonts", e);<br /> }<br /> pd4ml.enableDebugInfo();<br /> setFooter(pd4ml,<br /> settings);<br /> <br /> return pd4ml;<br /> }

    Rendering call:

    <br /> public void generatePdfBasedOnUrl(PdfGeneratorSettings settings,<br /> URL url) throws InvalidParameterException, IOException {<br /> getPd4mlInstance(settings,<br /> httpSession).render(url,<br /> settings.getOutputStream());<br /> }<br />
    JSP/HTML:

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><br /> <%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%><br /> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%><br /> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%><br /> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%><br /> <%@ taglib prefix="pd4ml" uri="http://pd4ml.com/tlds/pd4ml/2.6"%><br /> <br /> <html><br /> <head><br /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><br /> <style type="text/css"><br /> .clearfix:after {<br /> visibility: hidden;<br /> display: block;<br /> font-size: 0;<br /> content: " ";<br /> clear: both;<br /> height: 0;<br /> }<br /> <br /> body{<br /> width: 1350px;<br /> font-family: 'Archer Book';<br /> }<br /> <br /> #page1, #page2{<br /> border: 1px solid #000;<br /> padding: 1px;<br /> margin-top: 3px;<br /> height: 820px;<br /> width: 1344px;<br /> }<br /> <br /> #page1LeftSide, #page2LeftSide{<br /> /* border: 1px solid #000; */<br /> height: 818px;<br /> width: 650px;<br /> float: right;<br /> margin-right: 22px;<br /> left: -12px;<br /> position: relative;<br /> }<br /> #page1RightSide, #page2RightSide{<br /> /* border: 1px solid #000; */<br /> height: 818px;<br /> width: 650px;<br /> float: right;<br /> margin-left: 18px;<br /> }<br /> </style><br /> </head><br /> <body><br /> <font face="Archer Book">Hello Archer Book</font><br/><br /> </body><br /> </html>

    I have an older version (v381 I think?).

    Has anyone seen this, and how did they fix it?

    pd4
      in reply to: pdf’s Table right margin and the content is missing
      #29993

      We are using an application which automatically creates the html, based on the inputs we provide(same as the message body(text area) where we post a reply/query to any forum. for example the same pd4ml support forum page).Which is a standard functionality of that particular application.

      we are converting this auto generated html to pdf. So we can only work with the java code for this auto adjustment of the content of pdf document to fit to html width.
      we are facing this right margin and some content from right margin missing issue,specifically when the content of the html includes tables and multi level bulleted list.

      Can i auto adjust the table width to automatically adjust according to the html width?
      is there any java code phrase available for,auto page break option, when the text exceeds the html width limit?

      in reply to: HTML/CSS rendering issues
      #27124

      Version: pd4ml.pro.trial.3100

      When ‘li’ element contains block element like ‘p’ or ‘div’ generated RTF duplicates list markers with empty lines.

      Input HTML:

      <br /> <html><br /> <head><br /> </head><br /> <body><br /> <ul><br /> <li><p>Gebeuren er aanpassingen van confectieschoenen op medisch voorschrift?</p></li><br /> <li><p>Wordt dit voldoende geadministreerd / geborgd indeonderneming?</p></li><br /> </ul><br /> </body><br /> </html>

      Generated via UI demo application. File loaded from filesystem. Windows 10. Java: 1.8.0_102

      Output:

      #30003

      I am repeating my email comment here:

      loading java:archerfonts/Archer-Book.otf [1ms]<br /> reject TTF lookup for: 'archer book'<br /> can not read 'archer book' from java:archerfonts/Archer-Book.otf: java:archerfonts/Archer-Book.otf is .OTF font file with currently unsupported PostScript outlines ('CFF' glyph table instead of 'loca').<br />

      Under .OTF extension there can be two different font formats: TTF and Type1 (PostScript).

      Archer-Book.otf is obviously Type1. Java provides only limited support for Type1 fonts and in most of the cases it simply gives up by an attempt to instantiate java.awt.Font object from such .OTF file.

      As the only robust solution I would recommend to look for a similar TTF (or OTF of TTF format) font and to use it instead.

      in reply to: pdf’s Table right margin and the content is missing
      #30000

      The simplest solution is to scale down the content to match the given horizontal space.

      It can be done by an increasing of htmlWidth conversion parameter value.

      Alternatively you may rotate particular pages from portrait to landscape orientation to win some extra horizontal space.

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

      But the recent solution unfortunately does not satisfies your “without changing the HTML content” requirement.

      in reply to: pdf’s Table right margin and the content is missing
      #29994

      The content is cut right side as it does not fit given horizontal space, defined by htmlWidth parameter.
      htmlWidth can be seen as a frame width of a virtual web browser.

      The simplest solution is to scale down the content to match the space.
      It can be done by an increasing of htmlWidth conversion parameter value.

      Alternatively you may rotate particular pages from portrait to landscape orientation to win some extra horizontal space.

      See http://pd4ml.com/cookbook/pdf_dynamic_format_change.htm
      and
      http://pd4ml.com/cookbook/pdf_page_formatting.htm

      Also there is a method adjustHtmlWidth() http://pd4ml.com/api/org/zefer/pd4ml/PD4ML.html#adjustHtmlWidth()
      It tries to dynamically determine htmlWidth parameter value to let the content fit. But it is not efficient in all the cases. And by really wide content it may lead to tiny unreadable font sizes.

      #30004

      Thanks again for your help! I was able to use FontForge and convert my OTFs to TTFs and the old version of PD4ML was able to render correctly (at least the small subset of text I have in my proof of concept)

      #30005

      Thank you for the update! I was not sure FontForge is capable to convert one font type to another. I am glad it is.

      pd4
        in reply to: HTML/CSS rendering issues
        #27131

        Hi All,

        I am using the below code, in pd4ml probe and it works fine.

        pd4ml.addStyle(“table { word-wrap: break-word;font-style: italic;width: auto !important }”, true);

        But I used the same code in our application but it is not working,
        we are using the below jars,
        pd4ml-3.9.5.jar.
        ss_css2.jar

        Please suggest,if any other version is required.

      Viewing 15 posts - 3,361 through 3,375 (of 4,243 total)