Forum Replies Created

Viewing 15 posts - 3,121 through 3,135 (of 4,243 total)
  • Author
    Posts
  • in reply to: Troubleshooting
    #26962

    Dear support,
    We have faced with the following problem:

    Precondition. Our system provides printing capabilities for label printers. Label page size, margins (aka insets), font-size and font (aka font-family) are all the params which are set dynamically. Font-size is set on html level.

    Problem. Specified font-size is not kept at all and we created a formula, which generates appropriate userWidth( setHtmlWidth ) to maintain specified font-size.
    public static final long getCalucaltedHtmlWidth (int leftMarginMM, int rightMarginMM, int pageWidth, int fontSize){<br /> double weight = 13.7;<br /> double fontSizeKoef = (1 - fontSize*1.0/8 )* weight +16;<br /> return Math.round(fontSizeKoef*(pageWidth - leftMarginMM - rightMarginMM)/PD4Constants.TRANSLATE_FACTOR);<br /> }

    All the constants were defined experimentally. We tried protectPhysicalUnitDimensions() method to let pd4ml do stuff for us, but for some reasons it had no impact on maintaining predefined font-size.

    Please advice if there is any better approach than temporary solution chosen at the moment,

    thanks,

    in reply to: General questions / FAQ
    #27050

    Is there a way to embed an entire font in the PDF rather than just a subset? We are evaluating the software, and are likely going to purchase for an adding an upcoming feature to our product. This is one of the requirements.

    I currently am able to embed the font, but I can only get it to embed a subset. We have our fonts installed in a system directory and are using PD4ML through the java API:

    <br /> // FontUtil is our own internal class<br /> pd4ml.useTTF(FontUtil.getFontsDirectory().getAbsolutePath(), true);<br />

    The resulting PDF seems to just have subsets. If I open in Adobe reader and click File > Properties > Fonts, I see something like: CourierNewPSMT_PDF_Subset (Embedded)

    Is there anything I can do through the java API to embed the entire font?

    in reply to: Troubleshooting
    #27051

    I try to merge 2 PDF files
    This works fine almost every time
    But now we have some problems with PDF files

    Our code is as below

    public static boolean merge (String inFile1, String inFile2, String outFile){
    boolean success=false;
    try {
    InputStream inputstream1 = new FileInputStream(inFile1);
    InputStream inputstream2 = new FileInputStream(inFile2);
    OutputStream output = new FileOutputStream(outFile);

    org.zefer.pd4ml.PD4Document.mergePDFs(inputstream1, inputstream2, output);
    success=true;
    }
    catch(Exception e){
    System.out.println(e.getMessage());
    }

    return success;

    }

    The error message that we get is this
    org.zefer.pd4ml.npdf.parser.obj.h incompatible with org.zefer.pd4ml.npdf.parser.obj.d

    Do we use this method in wrong way?
    Why does some PDF files work and other don’t?

    in reply to: General questions / FAQ
    #27052

    Hi,
    we have implemented our custom ResourceProvider

    In case, we are including large resources, it will be better to provide resources as InputStream instead of byte array (to use less memory). Furthermore for resources such as file hosted on the file system, it is not efficient to load them as byte array instead of directly including them into the resulting PDF.

    What do you think of providing a new ResourceProvider that allow custom classes to override :

    InputStream getResourceAsStream(String resource, boolean debugOn)

    instead of:

    byte[] getResourceAsBytes(String resource, boolean debugOn)

    Thanks

    in reply to: General questions / FAQ
    #27053

    Hi,
    rendering this content :

    .

    generates an error message on the console:

    Bad Base64 input character 0x2e at 0 ([.])

    Tested with version: PD4ML 398fx3 Pro

    Thanks

    in reply to: Bad Base64 input character 0x2e at 0 ([.])
    #29844

    Try to use an empty tag or remove the dot from

    We’ll update the tag implementation to ignore tag content when dynvalue attribute is set.

    in reply to: ResourceProvider: replace byte array by inputstream
    #29843

    We plan to optimize resource loading / caching in totally refactored v4.x

    Your proposal would make sense only by attachment embedding. Other type of loaded resources do not win a lot:

    CSS – should be instantly loaded and parsed anyway

    images – PD4ML does not trust a file extension. It always loads an image and scans its bytes to determine image file type and dimensions. If explicitly configured, after that it unloads the image to a temp directory to free up RAM.

    Despite the impression, that it allocates a lot of memory because of images and other resources, it is not always true. A specifics of HTML rendering is that it should allocate a number of Java objects even for a single standalone whitespace. So parsed HTML (with layouting info) is the main “RAM eater”.

    in reply to: Error with Merge PDF problem, pd4ML.jar method mergeDFs
    #29842

    We’ve just fixed the issue in the development build.

    The reason is that in the problematic PDF an image size is unexpectedly given not as an integer, but as a reference to another object (which holds only an integer). Now the case is correctly worked around.

    in reply to: HTML/CSS rendering issues
    #27054

    Hi,

    We are using PD4ML 3.9.2 library for converting HTML documents to PDF. We have a requirement to validate the CSS Styles in HTML document before converting the same to PDF.

    We have been using the CSSSOMParser (from cssparser 0.9.17 jar) earlier to validate the CSS present in the HTML content.

    But since PD4ML uses ss_css2 3.9.2 , we ended up replacing the existing CSS jar i.e cssparser 0.9.17 with the ss_css2 3.9.2 due to jar conflicts.

    The CSSSomParser in cssparser 0.9.17 provides a ErrorHandler that can be used to validate the CSS which is not available with CSSSomParser in ss_css2 3.9.2 library.

    Could you please let me know if there are any plans of upgrading ss_css2 to use the latest cssparser jar OR are there any workaround that we can achieve validation of CSS styles in HTML using PD4ML 3.9.2

    -Thanks

    in reply to: Troubleshooting
    #27055

    Hey guys. This is my first post. Hope you guys can help me out.

    I have a page that I need in landscape. My default ‘orientation’ is set to ‘portrait’.

    I am trying to rotate my page with this line:
    <pd4ml:page.break pageFormat="rotate" />
    It works if there is HTML code before the line. If it’s the first line in my HTML body it doesn’t work. I.e. I add and empty tag and add the line after that. I will then get an empty page and then the landscape page I was aiming for.

    When I set my default page ‘orientation’ to ‘landscape’ it doesn’t have the same effect as rotate. It does return a page in ‘landscape’, but now the HTML table on this page overflows on the right hand side and doesn’t fit perfectly like when I use ‘rotate’.

    Thanks

    in reply to: HTML/CSS rendering issues
    #27056

    I am new to pd4ml and trying evaluation version, I try to use pd4ml java library

    Code Snippet:

    pd4ml.useTTF(“java:fonts”, true);
    pd4ml.enableDebugInfo();
    pd4ml.setHtmlWidth(1000);
    java.io.FileOutputStream fos = new java.io.FileOutputStream(“c:/test123.pdf”);
    pd4ml.render(“http://stage01:8080/&#8221;,fos);

    in the debug info i am getting

    version: PD4ML 398fx3 (eval)
    default built-in stylesheet parsed [19ms]
    loading http://stage02:8080/pm/#/login [636ms]
    using content encoding from HTTP header: UTF-8
    loading CSS file for http://stage02:8080/pm/css/ppm-lib.min.css
    not yet in cache: http://stage02:8080/pm/css/ppm-lib.min.css
    loading http://stage02:8080/pm/css/ppm-lib.min.css [1060ms]
    stylesheet ‘http://stage02:8080/pm/css/ppm-lib.min.css&#8217; parsed [129ms]
    CSS parsing errors (http://stage02:8080/pm/css/ppm-lib.min.css)
    line 5: unknown or misused CSS function: format []
    line 5: unexpected character ‘,’ [
    ]

    css parsing issues unexpected character ‘,’ []
    ……….

    in reply to: css parsing issues
    in reply to: css parsing issues
    #29852

    Help me in finding the cause of the css parsing issue.

    in reply to: General questions / FAQ
    #27057

    Hello ,

    I created the pd4fonts.properties with the command as below

    java -jar pd4ml.jar -configure.fonts /path/to/my/fonts/

    When I run my Java Program deployed on tomcat I get following debug info

    version: PD4ML 370 Pro (eval)
    not yet in cache: file:C:EpicFonts/pd4fonts.properties
    ‘serif’ is not in pd4fonts.properties file
    reject TTF lookup for: ‘serif’
    not yet in cache: file:C:WindowsFonts/times.ttf
    reject TTF lookup for: ‘times new roman’
    not yet in cache: file:C:WindowsFonts/cour.ttf
    reject TTF lookup for: ‘courier new’
    not yet in cache: file:C:WindowsFonts/gothic.ttf
    reject TTF lookup for: ‘century gothic’
    not yet in cache: file:C:WindowsFonts/calibri.ttf
    reject TTF lookup for: ‘calibri’
    not yet in cache: file:C:WindowsFonts/pala.ttf
    reject TTF lookup for: ‘palatino linotype’
    not yet in cache: file:C:WindowsFonts/impact.ttf
    reject TTF lookup for: ‘impact’
    not yet in cache: file:C:WindowsFonts/tahoma.ttf
    reject TTF lookup for: ‘tahoma’
    ‘helvetica’ is not in pd4fonts.properties file
    reject TTF lookup for: ‘helvetica’
    not yet in cache: file:C:WindowsFonts/l_10646.ttf
    reject TTF lookup for: ‘lucida sans unicode’
    not yet in cache: file:C:WindowsFonts/lucon.ttf
    reject TTF lookup for: ‘lucida console’
    not yet in cache: file:C:WindowsFonts/arial.ttf
    reject TTF lookup for: ‘arial’
    not yet in cache: file:C:WindowsFonts/ariblk.ttf
    reject TTF lookup for: ‘arial black’
    not yet in cache: file:C:WindowsFonts/arial-narrow_[allfont.net].ttf
    reject TTF lookup for: ‘arial narrow’
    not yet in cache: file:C:WindowsFonts/verdana.ttf
    reject TTF lookup for: ‘verdana’

    I used following code on Java Side

    pd4ml.useTTF(“C:EpicFontspd4fonts.properties”, true);

    Alternatively I downloaded allfont.zip file and added fonts.jar to deployment and tested and that too didn’t work.

    Please advice on what can be the problem.

    in reply to: General questions / FAQ
    #27058

    Hello,

    I am using pro version 370 of pd4ml . It is giving me error . None of the fonts are getting reflected. The error says “Problem reading font data” . The error log is as shown below.

    C:FontEpic
    version: PD4ML 370 Pro
    not yet in cache: file:C:FontEpic/pd4fonts.properties
    not yet in cache: file:C:WinFonts/gothic.ttf
    can not read ‘century gothic’ from file:C:WinFonts/gothic.ttf: Problem reading
    font data.
    reject TTF lookup for: ‘century gothic’
    not yet in cache: file:C:WinFonts/calibri.ttf
    can not read ‘calibri’ from file:C:WinFonts/calibri.ttf: Problem reading font data.
    reject TTF lookup for: ‘calibri’
    not yet in cache: file:C:WinFonts/pala.ttf
    can not read ‘palatino linotype’ from file:C:WinFonts/pala.ttf: Problem reading
    font data.
    reject TTF lookup for: ‘palatino linotype’
    not yet in cache: file:C:WinFonts/times.ttf
    can not read ‘times new roman’ from file:C:WinFonts/times.ttf: Problem reading
    font data.
    reject TTF lookup for: ‘times new roman’
    not yet in cache: file:C:WinFonts/impact.ttf
    can not read ‘impact’ from file:C:WinFonts/impact.ttf: Problem reading font data.
    reject TTF lookup for: ‘impact’
    not yet in cache: file:C:WinFonts/tahoma.ttf
    can not read ‘tahoma’ from file:C:WinFonts/tahoma.ttf: Problem reading font data.
    reject TTF lookup for: ‘tahoma’
    ‘helvetica’ is not in pd4fonts.properties file
    reject TTF lookup for: ‘helvetica’
    not yet in cache: file:C:WinFonts/l_10646.ttf
    can not read ‘lucida sans unicode’ from file:C:WinFonts/l_10646.ttf: Problem re
    ading font data.
    reject TTF lookup for: ‘lucida sans unicode’
    not yet in cache: file:C:WinFonts/lucon.ttf
    can not read ‘lucida console’ from file:C:WinFonts/lucon.ttf: Problem reading f
    ont data.
    reject TTF lookup for: ‘lucida console’
    not yet in cache: file:C:WinFonts/arial.ttf
    can not read ‘arial’ from file:C:WinFonts/arial.ttf: Problem reading font data.

    reject TTF lookup for: ‘arial’
    not yet in cache: file:C:WinFonts/ariblk.ttf
    can not read ‘arial black’ from file:C:WinFonts/ariblk.ttf: Problem reading fon
    t data.
    reject TTF lookup for: ‘arial black’
    not yet in cache: file:C:WinFonts/arial-narrow_[allfont.net].ttf
    can not read ‘arial narrow’ from file:C:WinFonts/arial-narrow_[allfont.net].ttf
    : Problem reading font data.
    reject TTF lookup for: ‘arial narrow’
    ‘serif’ is not in pd4fonts.properties file
    reject TTF lookup for: ‘serif’
    not yet in cache: file:C:WinFonts/verdana.ttf
    can not read ‘verdana’ from file:C:WinFonts/verdana.ttf: Problem reading font data.
    reject TTF lookup for: ‘verdana’
    not yet in cache: file:C:WinFonts/COPRGTL.TTF
    can not read ‘copperplate gothic light’ from file:C:WinFonts/COPRGTL.TTF: Problem reading font data.
    reject TTF lookup for: ‘copperplate gothic light’
    not yet in cache: file:C:WinFonts/33535gillsansmt.ttf
    can not read ‘gill sans mt’ from file:C:WinFonts/33535gillsansmt.ttf: Problem
    reading font data.
    reject TTF lookup for: ‘gill sans mt’
    not yet in cache: file:C:WinFonts/trebuc.ttf
    can not read ‘trebuchet ms’ from file:C:WinFonts/trebuc.ttf: Problem reading font data.
    reject TTF lookup for: ‘trebuchet ms’
    not yet in cache: file:C:WinFonts/cour.ttf
    can not read ‘courier new’ from file:C:WinFonts/cour.ttf: Problem reading font
    data.
    reject TTF lookup for: ‘courier new’
    not yet in cache: file:C:WinFonts/georgia.ttf
    can not read ‘georgia’ from file:C:WinFonts/georgia.ttf: Problem reading font
    data.
    reject TTF lookup for: ‘georgia’

Viewing 15 posts - 3,121 through 3,135 (of 4,243 total)