Forum Replies Created

Viewing 15 posts - 1,591 through 1,605 (of 4,243 total)
  • Author
    Posts
  • in reply to: Urgent -Bad pdf layout – it span only 1/4 of normal width
    #28751

    Thanks for the explanation.

    The reason that I add “converter.adjustHtmlWidth()” is to try to fix another issue reported by customer — sometimes, the content (or table column) was chopped off on the page right side.

    Adding “converter.adjustHtmlWidth()” solves that issue. Unfortunately it causes current issue in certain pdf report -3/4 of page shows blank.

    in reply to: PD4ML Tips & Tricks
    #26649

    How can i display currency symbols in generated pdf?

    in reply to: Display Currency symbols in pdf
    #28768

    It should be no problem to display currency symbols if they are part of Latin-1 charset. If not, you have to unilize TTF embedding feature of PD4ML Pro.

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

    in reply to: HTML/CSS rendering issues
    #26650

    Hi,
    I have been using PD4ML successfully in our product (volume license) for a while now creating PDFs – it’s a great! With an increased demand to also export to Word, I am excited that you have implemented RTF export as well. However, I have come across some challenges:

    Headers and footers
    I am not able to control the height of header/footer. Also I am not able to use multiple headers/footers – it seems that the last used will be on all pages regardless. Looking at the RFT spec, the format seems rather limited, but I see that it is possible to have a different footer/header on the first page (headerf) which I would assume is the most common need.

    Margins
    I am not able to control any margins. Looking at the generated RTF, page margins are printed out, but is it a way to control this in the template, e.g. through the body? This is how it looks in a text editor, also showing paper height and width:

    paperw11900paperh16840margl800margr400margt400margb400

    I believe it should be possible to do this on a paragraph level in RTF.

    Unwanted line breaks
    When I put e.g. tables on top of each other, I always get additional space below. Here is a simple example:



    Before table

    Table1
    Table2

    After table

    As you will see, you get two unwanted line breaks between the tables, as well as one below the second table before the text. It looks like the paragraphs in the RTF are causing it. Looking at some examples online, I am able to modify the RTF to work as I want. This is done by rather starting with pard instead of par, but then make sure that all text block, like “Before table” is done like this:

    {pard Before table par}

    Without the syntax on either side of the text, the table will bleed onto it. Further, I have modified the table syntax where I start with pard (and no par):

    {pard
    trowd…..

    }

    I am by no means an expert in RTF, and I completely understand if these things can’t be accomplished. But please take it into consideration, as I feel a bit helpless at the moment with the issues listed. Will these things be part of a release do you think, and if so, approximately when?

    Here is the modified RTF that has no additional breaks:

    {rtf1
    {info
    {title }
    }
    paperw11900paperh16840margl800margr400margt400margb400widowctrlf1i0b0fs16{fonttbl{f1 Times New Roman;}
    }
    {colortbl;red0green0blue0;
    }
    {lisb30widctlpar{widctlparcf1f1i0b0fs26 {pard Before table par}
    {pard
    trowdtrrh385clvertalcclbrdrtbrdrsbrdrw17clbrdrbbrdrsbrdrw17clbrdrlbrdrsbrdrw17clbrdrrbrdrsbrdrw17clpadl17clpadr17clpadt17clpadb17clpadfl3clpadfr3clpadft3clpadfb3clshdrawnilcellx803pardintblcf1 Table1plaincellpardintblrow
    }
    {pard
    trowdtrrh385clvertalcclbrdrtbrdrsbrdrw17clbrdrbbrdrsbrdrw17clbrdrlbrdrsbrdrw17clbrdrrbrdrsbrdrw17clpadl17clpadr17clpadt17clpadb17clpadfl3clpadfr3clpadft3clpadfb3clshdrawnilcellx803pardintblcf1f1i0b0fs26 Table2plaincellpardintblrow
    }
    cf1f1i0b0fs26 {pard After table par}
    }
    par}}

    in reply to: Troubleshooting
    #26651

    Hi.

    I have a problem during my work. I’m using pd4ml to convert html to pdf successfully,
    yet changing the orientation to landscape cannot be done by now.

    I suspect that, since Tomcat doesn’t support all JMS features, perhaps it also doesn’t support the AWT.dimension Java.awt.Insets exports.

    what do you say? any help suggestions? this is quite urgent…

    Thanks Ahead,
    Shiri.

    in reply to: problem changing orientation with tomcat
    #28776

    anyone??

    please?

    I cannot progress unless I solve this issue.

    Thanks ahead for the replies…

    p.s:

    I used the following code, tring to get landscape orientation while converting html files to pdf:

    “<%@ taglib uri="http://pd4ml.com/tlds/pd4ml/2.6" prefix="pd4ml" %> <%@ taglib uri="http://pd4ml.com/tlds/pd4ml/2.6" prefix="pd4ml" %><%@page contentType="text/html; charset=ISO8859_1"%>


    …”

    and


    private static void generatePDF(String inputHTMLFileName, File outputPDFFile, Dimension2D format, String fontsDir, String headerBody)
    throws Exception {

    java.io.FileOutputStream fos = new java.io.FileOutputStream(outputPDFFile);
    PD4ML pd4ml = new PD4ML();
    pd4ml.setPageInsets(new Insets(0, 0, 0, 0));
    pd4ml.setHtmlWidth(1600);
    pd4ml.setPageSize(pd4ml.changePageOrientation((Dimension)format)); // landscape page orientation
    if ( fontsDir != null && fontsDir.length() > 0 ) {
    pd4ml.useTTF( fontsDir, true );
    }
    if ( headerBody != null && headerBody.length() > 0 ) {
    PD4PageMark header = new PD4PageMark();
    header.setAreaHeight( -1 ); // autocompute
    header.setHtmlTemplate( headerBody ); // autocompute
    pd4ml.setPageHeader( header );
    }
    pd4ml.enableDebugInfo();
    pd4ml.render(“file:” + inputHTMLFileName, fos);
    }

    public static void doPDFConvertion(String htmlPath,String outputFile)
    {

    String htmlFileName =htmlPath;
    File pdfFile = new File(outputFile);

    try
    {
    generatePDF(htmlFileName, pdfFile, (Dimension2D)PD4Constants.A4, null, null );
    }
    catch(Exception e)
    {
    int i=0;
    }
    System.out.println(“done.”);
    }

    Thanks ahead…

    in reply to: problem changing orientation with tomcat
    #28777

    Could you please publish a sample of a dummy PDF with “landscape” directive, generated in your environment.

    in reply to: Urgent -Bad pdf layout – it span only 1/4 of normal width
    #28752

    > it causes current issue in certain pdf report -3/4 of page shows blank

    It should happen only in situations, when the source HTML has elements with width=”100%”, which leave no “blank space” to be cut with adjustHtmlWidth()

    in reply to: Troubleshooting
    #26647

    Like many people these days I use .jspx files.

    I have successfully made a perfectly rendered .pdf file by using the pd4ml:transform tag in a classic ‘apache tiles’ default.jspx file.

    As you may know, the default.jspx file is a useful shell that you can place round any number of other nested .jspx files.

    In fact for this reason the default.jspx file would be a perfect place to put my pd4ml:transform tags, where I would use the ‘enable’ attribute to turn pdf production on and off.

    Unfortunately only ‘enable=true’ works.

    If I use ‘enable=false’, I get the dreaded error:
    ‘getOutputStream() has already been called for this response’.

    I have of course read your faqs and know that the transform tag should be placed in a position where any possible white spaces before it have been removed.

    Unfortunately however .jspx files insist on outputting the root xml tag before the transform tag can kick in (I can see this in the compiled class for the .jspx file) but this is only a problem when enable=false. And I need the root xml tag because it contains the url of the .tld file for pd4ml.

    Firstly I was just wondering why there is this problem, because obviously pd4ml should be quiet and mind its own business when enable=false.

    Secondly just wondering if you can think of any possible solution for this.

    Thank you for your time.

    in reply to: problem changing orientation with tomcat
    #28778

    ok.

    Here is a the pdf. it’s orientation suppose to be ‘landscape’.

    (The code seems to ignore the html definitions in the transform tag..)

    in reply to: problem changing orientation with tomcat
    #28779

    > Here is a the pdf
    I would call it PNG

    in reply to: HTML/CSS rendering issues
    #26652

    I’m using PD4ML 3.7.1b14

    In RTF_WMF rendering, I can’t seem to get any font formatting through. I’m using spans inside of a chunk of text in a div. For example:

    The <span class="hl" style="font-weight:bold; background-color: #FFA37C;">Accountability</span> of Dr. Aspogerikas had not been taken into consideration.

    Something like this should be giving a background and a font weight to “Accountability” but it seems to do neither. Is there a special option that must be turned on to get this to work?

    in reply to: problem changing orientation with tomcat
    #28780

    Preheps there’s a chance to split the html table to two different parts easily?

    The problem is that,when the table is too large,we loose information this way.

    Thanks ahead…

    in reply to: Troubleshooting
    #26653

    Is there a way for splitting the html table to two different parts easily?

    The problem is that, when the table is too large, we loose information this way.

    Thanks ahead…

    in reply to: problem changing orientation with tomcat
    #28781

    I guess you mean table too wide for a single page.

    Unfortunately PD4ML offers no way to split a table to columns, that fit a single page width.

    Usual solution is to increase htmlWidth conversion parameter. But in the case it scales down the content and at particular values the content is not readable anymore in printed form.

    The best approach would be re-think the table layout itself to make it print-friendly: probably to combine some columns etc

Viewing 15 posts - 1,591 through 1,605 (of 4,243 total)