Forum Replies Created

Viewing 15 posts - 3,886 through 3,900 (of 4,234 total)
  • Author
    Posts
  • in reply to: Page number not full when converting HTML to PDF
    #34573

    Hi! The issue has been fixed on 2021-10-28 in v4.0.10. Also the most recent v4.1.0 snapshot has to include the bugfix.
    Please give it a try.

    in reply to: Page number not full when converting HTML to PDF
    #34575

    Hi,
    I’m converting from html to pdf using Java (Using pd4ml 4.0.10 in maven):
    For eg:
    public static void convert(String inputFile, File output) throws InvokeException, IOException { PD4ML pd4ml = new PD4ML(); PageSize pageSize = new PageSize(600, 842); pd4ml.setPageSize(pageSize); PageMargins pageMargins = new PageMargins(70, 36, 56, 36); pd4ml.setPageMargins(pageMargins); File file = new File(inputFile); FileInputStream is = new FileInputStream(file); pd4ml.readHTML(is, null, StandardCharsets.UTF_8.name()); FileOutputStream outputStream = new FileOutputStream(output); pd4ml.writePDF(outputStream, "pdf"); }

    Html for the footer:
    <pd4ml:page.footer scope="1"> <section class="export-page-footer"> <tr > <td class="right"> <span class="pagenum">pag. $[page]</span> </td> </tr> </section> </pd4ml:page.footer>

    Still shows me as:
    pag. 1 for all pages from 10-19, after pag.9
    and pag. 2 for all pages from 20-29, etc..

    Any help would be appreciated.

    in reply to: Page number not full when converting HTML to PDF
    #34677

    Hi,

    This issue is not yet fixed in 4.0.10 and still persists in 4.0.13. Is there any plan to fix?

    Thanks,
    Sanghamitra

    in reply to: Technical questions / Troubleshooting
    #34752

    So I have been using pd4ml for a long time. We mainly use the render method and pass it a url for the jsp in question. There are times we use the OutputStream of the HttpServletResponse, and sometimes we Use a FileOutputStream and save a pdf on a file system. It was just brought to my attention that the pdf files are being created and are blank. They are about 2K in size instead of 600-700K. PDFs in the Browser are just fine. These PDFs were being written to a File Server directly. I decided to try to write locally on the web server to a temp folder and then copy. On my local machine that worked just fine. But when I promoted to my DEV server, the file being written to the temp folder was blank.

    This is PD4ml v.3, running on Tomcat9, Java 8. My local workstation and dev server are pretty close version-wise, although I am running Eclipse and a local Tomcat instance in that, and the dev server is running the Tomcat Service Wrapper. But both are Tomcat9, Java8, etc. Any ideas why it would run ok on my instance, but not DEV?

    I did upgrade from Tomcat7 recently, so that could be related, but then I shouldn’t be able to work on my local instance. I can’t revert Tomcat to v7 for security reasons, and would think this should be able to work given it works for my local instance. Any help is appreciated!

    in reply to: PDF File not being created
    #34753

    Hi!
    Please enable debug mode of PD4ML and inspect the server logs for possible PD4ML error messages or diagnostic output.
    Also please open the generated 2K PDFs in a text editor and copy-paste its content to the thread to be reviewed. Thanks!

    in reply to: PDF File not being created
    #34754

    I was able to fix this. It ended up being an HTTP/HTTPS issue. It was something I fixed in a few spots months ago, but apparently missed one. I am able to make sure the url is HTTPS and it is all good.

    in reply to: PDF File not being created
    #34755

    Glad the issue is solved!

    in reply to: Technical questions / Troubleshooting
    #34756

    Hello,

    Is there a possibility to set metadata (Title, LANG) for PDF UA feature through PD4ML api rather than in the content of HTML?
    I’ve found a sample where this data is passed in HTML tags. I’m trying to use PD4ML.addMetadata(“lang”, “DE-de”, false) method but it seems does not change language metadata.
    Could you please suggest an option?

    Thanks,
    Nina

    in reply to: PDF UA set LANG metadata
    #34757

    Hi Nina,

    the title can be set with void setDocumentTitle(String title) API call. But with lang it is a bit more tricky.

    Try the following:
    pd4ml.addStyle("HTML, BODY {lang: DE-de !important}", true);

    in reply to: PDF UA set LANG metadata
    #34769

    Thank you, it works!
    One more question, is that possible to set other metadata values (Subject, Keywords, Creator, Producer, CreationDate, ModDate and Trapped) using something like PD4ML.set*** similarly to setDocumentTitle() and setAuthorName()? I cannot find corresponding methods for these fields in the PD4ML class api.

    in reply to: PDF UA set LANG metadata
    #34772

    See addMetadata() Javadoc

    The method updates PDF’s XMP metadata.

    Note, that date may appear in PDF in two different formats.

    XMP metadata: “2009-11-27T18:25:45+01:00”
    PDF info object: “D:20091127182545+01’00′”

    So you’ll probably also need to call pd4ml.setParam(Constants.PD4ML_DOCUMENT_DATE, "D:20091127211216+01'00'"); to keep the doc dates in sync

    in reply to: Technical questions / Troubleshooting
    #34773

    Hi, please note that I just installed my license pd4ml-4.0.13.jar but I cannot see the spanish accent characters.
    See attached. It states ‘Cotizaci?n’ instead of ‘Cotización’ (this is the spanish word for Quotation)

    Thank you for your help.

    Attachments:
    You must be logged in to view attached files.
    in reply to: PDF UA set LANG metadata
    #34775

    addMetadata() tells that I should not use keys for standard properties:

    key – a unique name, which must not be one of the standard property names Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate and Trapped

    So, could you please confirm that I can use addMetadata() method to set these properties?

    in reply to: Spanish accent characters
    #34776

    Hi! Most probably you did not configure TTF embedding.
    See https://pd4ml.tech/pdf-fonts/

    in reply to: PDF UA set LANG metadata
    #34777

    Sorry for the misleading hint. You are right, addMetadata() is a wrong way.

    PD4ML allows to override “Creator” via environment variable:
    System.getProperty( “pd4ml.creator.application”, cLogo );

    “Author”
    “Keywords”
    “Subject”

    can be set in <head> section of HTML with i.e <meta name=”Keywords” content=”test meta”>

Viewing 15 posts - 3,886 through 3,900 (of 4,234 total)