Forum Replies Created

Viewing 15 posts - 1,531 through 1,545 (of 4,249 total)
  • Author
    Posts
  • in reply to: Trouble with server encoding (ISO-8859-15)
    #28717

    That is a clear sign, that the source HTML has a directive with ISO-8859-1. Try to change it to ISO-8859-15 and make sure you also utilize TTF embedding feature of PD4ML.

    pd4ml-html-css-pdf-tips-tricks-f7/ttf-embedding-t42.html

    in reply to: Progress Monitor/Feedback mechanism during PDF generation
    #28684

    Sorry, we still not updated the documentation.

    The code below implements a simple dump of progress messages. Just combine the approach with your progress meter component state update.

    The current implementation probably still needs some balance refining between HTML parding, layouting and PDF output phases. However on our test scenarios the progress indication looks more-less smooth.

    [language=java:1e45c9tp]pd4ml.monitorProgress(new ProgressMeter());

    public class ProgressMeter implements PD4ProgressListener {

    public void progressUpdate(int messageID, int progress, String note, long msec) {
    String tick = String.format( “%7d”, msec );
    String progressString = String.format( “%3d”, progress );

    String step = “”;
    switch ( messageID ) {
    case CONVERSION_BEGIN:
    step = “conversion begin”;
    break;
    case HTML_PARSED:
    step = “html parsed”;
    break;
    case DOC_TREE_BUILT:
    step = “document tree structure built”;
    break;
    case HTML_LAYOUT_IN_PROGRESS:
    step = “layouting…”;
    break;
    case HTML_LAYOUT_DONE:
    step = “layout done”;
    break;
    case TOC_GENERATED:
    step = “TOC generated”;
    break;
    case DOC_OUTPUT_IN_PROGRESS:
    step = “generating PDF…”;
    break;
    case NEW_SRC_DOC_BEGIN:
    step = “proceed to new source document”;
    break;
    case CONVERSION_END:
    step = “done.”;
    break;
    }

    System.out.println( tick + ” ” + progressString + ” ” + step + ” ” + note );

    }
    }[/language:1e45c9tp]

    in reply to: How to find out if a page break has occurred
    #28549

    I think I’ve found a solution: avoid having to know about the pagebreaks.
    The trick is to unset/set the page headers the way shown to prevent having the country name printed twice.
    The issue reported in this thread (multiple page headers) is fixed in version 3.8.

    I will not adapt the example to fit the older examples 🙂

    <br /> <table style="page-break-inside: avoid;"><br /> <pd4ml:page.header><br /> </pd4ml:page.header><br /> <tr><br /> <th>Italy</th><br /> </tr><br /> <tr><br /> <td>Item 1</td><br /> </tr><br /> </table><br /> <pd4ml:page.header><br /> <table><br /> <tr><br /> <th>Italy (Continued)<br>Company 1</th><br /> </tr><br /> </table><br /> </pd4ml:page.header><br /> <table><br /> <tr><br /> <td>Item 2</td><br /> </tr><br /> ...<br /> </table><br /> <pd4ml:page.header><br /> <tr><br /> <th>Italy (Continued)</th><br /> </tr><br /> </pd4ml:page.header><br /> <table style="page-break-inside: avoid;"><br /> <tr><br /> <td>Company 2</td><br /> </tr><br /> <tr><br /> <td>Item 1</td><br /> </tr><br /> </table><br /> <pd4ml:page.header><br /> <table><br /> <tr><br /> <th>Italy (Continued)<br>Company 2</th><br /> </tr><br /> </table><br /> </pd4ml:page.header><br /> <table><br /> <tr><br /> <td>Item 2</td><br /> </tr><br /> ..<br /> </table>

    Output:
    Italy
    Company 1
    Item 1
    Item 2
    Item 2
    Item 3
    Item 4
    Item 5
    Item 6
    Item 7
    Item 8
    Item 9
    <>
    Italy (Continued)
    Company 2
    Item 1
    Item 2
    Item 2
    Item 3
    Item 4
    Item 5
    Item 6
    Item 7
    Item 8
    Item 9
    <
    >
    Italy (Continued)
    Company 2
    Item 10
    Item 11
    Item 12
    Item 13
    Item 14
    Item 15
    Item 16

    in reply to: Progress Monitor/Feedback mechanism during PDF generation
    #28685

    Many thanks… I will check it out.

    in reply to: Trouble with server encoding (ISO-8859-15)
    #28718

    I changed the page encoding and now it is not returning this line in log.

    I tried specifying the encoding in the render method, but it doesn’t work.

    <br /> StringReader input = new StringReader(content);<br /> <br /> HashMap map = new HashMap();<br /> map.put( "pd4ml.extra.resource.loaders", "package.CustomFileResourceProvider" );<br /> pd4ml.setDynamicParams(map);<br /> pd4ml.render(input,fos);<br />

    I removed all page content and only printing “HELLO” and then I tried printing the “content” value:
    <br /> <?xml version="1.0" encoding="ISO-8859-15"?><html xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml"><br /> <head><br /> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" /><br /> </head><br /> <body><br /> HELLO<br /> <br /> </body><br /> </html><br />

    I also tried by specifying TTF with these lines:
    <br /> pd4ml.useTTF( "java:fonts", true );<br /> pd4ml.setDefaultTTFs("Times New Roman", "Arial", "Courier New");<br />

    It continues returning an empty PDF as the one I attach.

    in reply to: Progress Monitor/Feedback mechanism during PDF generation
    #28686

    Am I mistaken or does the current downloadable version of pd4ml.pro.trial.380.zip not include the new PD4ProgressListener interface? I have included a screenshot of the jar file dir “org/zefer/pd4ml”. The API documentation seems to be correct in the zip file though

    Also, the API on the website (http://pd4ml.com/api/index.html) uses an older version and makes no mention of the PD4ProgressListener interface.

    Thanks,
    Burton

    in reply to: Page-break cutting accent when page breaks
    #28705

    Ok! Thank you!
    I’m waiting…

    @PD4ML wrote:

    We reproduced the issue – it seems to be a bug with header height computations.
    We plan to find a solution till the next beta release.

    As a workaround I would recommend to use inline header definitions with ; however there are some scenarios, where it is quite tricky to use the tag – for example if your source documents are read-only and cannot be modified.

    in reply to: General questions / FAQ
    #26627

    First of all, job well done on the progress monitor. Much appreciated for providing this functionality!

    One suggestion… the monitor currently displays a progress of 92% on step “DOC_OUTPUT_IN_PROGRESS”. For a 5000+ page document this % can be very misleading since it’s the most time intensive for larger documents (at least in my case). Any way to provide more accurate % for this step? Perhaps this step should be more like 85% and the monitor would call “progressUpdate()” throughout the actual PDF generation? Thoughts?

    in reply to: General questions / FAQ
    #26629

    If image is not there in the mentioned path, in pdf file image tag is getting displayed other than tag if any solution is there to display default image.

    in reply to: General questions / FAQ
    #26630

    I am encountering a very strange behavior related to pd4ml rendering text with font Arial (located in a folder with the fonts property file set correctly).

    I am using an OpenSUSE linux installation over AWS (Amazon) for rendering PDF files in English and Hebrew using Arial font. When I am logging-in through PuTTy to my root account and restart my tomcat the rendering works smoothly.
    However, when I set my tomcat as a daemon (in init.d) to start at computer restart, my webservice works with no problem but pd4ml fails to render the hebrew fonts with Arial (display question marks instead).
    It doesn’t seem to be a problem with a path not set to the font property file because I am using the same path for other purposes in my webservice with no problem.

    I believe that it is some kind of service I am not loading but I could not find any.

    I will really appreciate any kind of help
    Thanks
    Assaf

    in reply to: initialPageNumber
    #28396

    Hey…

    I come across another questions while further implementing PD4ML.
    We are trying got use “pd4ml.print.dialog.popup”, but again it is not available via PHP param feature.
    Is there a different way to force the print window? Or do we have to implement it in the wrapper ourself? (If you could provide us with that feature as you did last time, that would be really great.).

    And the second questions relates unique numbers in printed documents.
    We create PDF files with tags on each page, and each tag has its unique number.
    Now we want to directly print that page out instead of opening the PDF in the user window (even when the print dialog opens directly, there is no way to tell if the tags were printed or not…).
    Is there any simple to do that? One suggestion we found was to write the PDFs in a specific folder on the server, and have the server check for the files and each time it found one, that one will be printed.

    Thank you very much for your Help!

    Kind regards
    Niels Göran

    in reply to: initialPageNumber
    #28397

    In theory the following command-line parameter should produce PDFs pop the print dialog automatically up:
    -param pd4ml.print.dialog.popup true
    Please give a try.

    I am not sure if I understood your second question correctly, as “PDF tag” can mean different things.

    So you would like to autoprint some sections of generated PDF documents? I do not know what you are going to use on the sever side as a print application, but if it should be “standard” Acroread, I would to take a look to the attached document. Acroread command-line parameters allow to jump to a particular section of a PDF document (marked as a named destination).

    By the link you may find Acroread command line options for silent printing:
    html-pdf-faq-f1/automatically-open-print-dialog-t158.html

    Probably by combining the named destination jump and the silent print command you’ll achieve the needed functionality.

    in reply to: HTML/CSS rendering issues
    #26631

    The HTML we are passing to the converter is fairly simple and consists of the following line:

    This is a A&B test; what will it do?

    But the converter seems to get confused about what to do with the ampersand and the semi-colon, and it outputs:

    This is a A& test; what will it do?

    Notice how it removes the “B” from “A&B”. Is this a bug with the converter?

    in reply to: Troubleshooting
    #26632

    What is the easiest way to troubleshoot images not appearing in the generated pdf?

    Here are the circumstances:

    1. Using demo jar recently downloaded.
    2. Using passthru from php.
    3. Server is ubuntu
    4. Images that are not appearing are on another internal server. I don’t control the server but I have access to the person who does.
    5. I can load the images in my browser. (either by entering their url or by rendering the html being converted).
    6. Images from localhost (i.e. the ubuntu server itself accessed via full url) AND from other external servers are appearing fine. E.g. I loaded the google logo from google.com.
    7. I can ping the images server from the ubuntu server.
    8. I tried putting ‘-debug’ at the end of my passthru command and still nothing appears in the apache error or access log.

    Any suggestions on what else I should be looking for?

    Thanks

    in reply to: General questions / FAQ
    #26633

    Hopefully this is the correct forum for my question…if not, feel free to move this post.

    I’m currently evaluating multiple products to transform HTML files into PDF files. The current software we use is no longer supported so we have to find a replacement. So far, I have been able to replicate everything we do currently using PD4ML except for one issue.

    Basically, in our current HTML that gets converted to PDF, the images and CSS sheets are referenced like the following:

    And then in our current software, we define a ‘base’ directory to use for all of these input type files. Notice the ‘/’ at the beginning of the path about. I know this is not standard but our current software is smart enough to figure it out and the files are imported into the conversion process just fine.

    One of the other software packages I have written a demo with did not handle this the way we would want but they have a specific method where you can add an XSL file to run first on the inputed HTML file before the conversion to PDF. So…I have a simple XSL file that strips the leading ‘/’ off of paths from ‘src’ and ‘href’ tags and then the conversion works fine.

    Is there something equivalent for PD4ML? I know I could do the XSL translation in code first before calling PD4ML but just wanted to make sure I was not missing something when I present my findings from the evaluation.

    Our clients have hundereds of HTML files that get converted to PDF on a daily basis and would rather not have to manually update all of them to remove the starting slash.

    Thanks.

Viewing 15 posts - 1,531 through 1,545 (of 4,249 total)