Forum Replies Created
-
AuthorPosts
-
in reply to: Long word / link doesn’t break up into second line December 19, 2011 at 17:42#28738
CSS style “word-wrap: break-word” should help.
if your document is read-only, you may apply it via PD4ML API:pd4ml.addStyle("BODY, DIV, TD { word-wrap: break-word }", true);in reply to: HTML/CSS rendering issues December 20, 2011 at 06:24#26642Hi,
I am currently evaluating PD4ML, using it in Coldfusion.
I am very pleased so far.When I generate a TOC with the
<pd4ml:toc> tag, I have a title and a subtitle above the tag. Both are headings. Code looks like this: <h1 style="pd4ml-bookmark-visibility: hidden;">[!TITLE!]</h1> <h2 style="pd4ml-bookmark-visibility: hidden;">[!SUBTITLE!]</h2> <pd4ml:toc>
As you see I was trying to hide these 2 titles from the TOC, with what I thought was the correct command: pd4ml-bookmark-visibility: hidden
Unfortunately they still show up. What am I doing wrong?
Cheers,
Mattijs
in reply to: HTML/CSS rendering issues December 20, 2011 at 06:26#26644Hi,
I am currently evaluating the product and I ran into a chaching issue.
I use PD4ML with Coldfusion.With CFML I generate the HTML and then feed that to a PD4ML object in
CFSCRIPT:<cfscript> pd4ml = createObject("java","org.zefer.pd4ml.PD4ML"); </cfscript>No while experimenting with a pdf generation tool, I noticed that my CSS links are not refreshed. The content of the seperate CSS file is being cached.
Only when I add:
pd4ml.clearCache();
does it refresh.Is this correct or is this inefficient?
Thanks,
Mattijs
in reply to: BMP in BASE64 encoding December 20, 2011 at 07:30#28732Many thanks!!! I didn’t take litte endian into account. Now it is working.
in reply to: General questions / FAQ December 20, 2011 at 11:38#26645Any plans when tbody, thead and tfoot will be supported?
in reply to: Merge failing December 20, 2011 at 19:26in reply to: Merge failing December 20, 2011 at 21:48#28742Currently (v380) PDF parser of PD4ML has a number of limitations: it cannot parse linearized PDFs and edited PDFs (which have multiple xref tables).
It would be helpful if you publish the original PDF document you tried to merge to. We’ll check if the problem is known and if there is a workaround.
in reply to: Troubleshooting December 21, 2011 at 15:53#26646Hi,
In our product, PD4ML is being used to generate pdf report from html.
One of our customers generated the report which is very badly formated (although html file looks fine) – On each page, it spans 1/4 portion of page on the left, while other 3/4 page on the right is blank.I am not sure how to attach screenshot here but if you give me a email address, I can send you screenshot.
Below is the snippet of code that I used PD4ML to generate pdf:
public InputStream render(List
<InputStream> pages, Map<ReportMetadata, Serializable>reportMetadata)
throws RenderingException {boolean landscapeView = false;
if (reportMetadata.containsKey(ReportMetadata.ORIENTATION)
&& “landscape”.equalsIgnoreCase(reportMetadata.get(ReportMetadata.ORIENTATION).toString()))
landscapeView = true;PD4ML converter = new PD4ML();
converter.setPageSize( landscapeView ? converter.changePageOrientation( PD4Constants.LETTER ): PD4Constants.LETTER );
converter.setPageInsets(new Insets(20, 50, 10, 10));
converter.enableImgSplit(false);
converter.enableTableBreaks(true);if(landscapeView)
converter.setHtmlWidth(1000);
else
converter.setHtmlWidth(PD4Constants.LETTER.width);converter.adjustHtmlWidth();
try {
File report = File.createTempFile(“pdfreport”, “.pdf”);List
<File> pdfs = new ArrayList<File>();
File pdf;// for each page
for (InputStream page : pages) {// create PDF
pdf = File.createTempFile(“pdfreportpage”, “.pdf”);
pdfs.add(pdf);
converter.render(new InputStreamReader(page),
new FileOutputStream(pdf));
}PDFUtils.merge(pdfs, report);
for(File tmpFile :pdfs)
tmpFile.delete();
return new FileInputStream(report);} catch (IOException e) {
throw new RenderingException(e);
} catch (DocumentException e) {
throw new RenderingException(e);
}
}in reply to: Problem removing anchor underline using text-decoration December 21, 2011 at 16:55#28734I’m having the same issue.
Just by using
a {
color:black;
text-decoration:none;
}doesn’t remove the underline part, but does change the color.
Thanks!
in reply to: Urgent -Bad pdf layout – it span only 1/4 of normal width December 21, 2011 at 17:47#28746Attach generated pdf
in reply to: Urgent -Bad pdf layout – it span only 1/4 of normal width December 21, 2011 at 18:16#28747try again to attach screenshot
in reply to: Urgent -Bad pdf layout – it span only 1/4 of normal width December 21, 2011 at 18:45#28748It looks like htmlWidth conversion parameter value (frame width of virtual web browser) is set too big.
Also there is some garbage characters: it is caused by an invalid or missing charset directive in the source document.
The document HTML source and resulting PDF would help to analyze the issue. Please publish or send to support pd4ml com
in reply to: Urgent -Bad pdf layout – it span only 1/4 of normal width December 21, 2011 at 19:48#28749I replaced “converter.adjustHtmlWidth()” with “convert.fitPageVertically()”, then everything starts to work fine.
Is it safe to do so? what’s differene between these 2 method calls?in reply to: HTML/CSS rendering issues December 22, 2011 at 08:30#26648Hi
I’ve implemented PD4ML Pro in our application. We’ve been using pd4ml tld to transform the JSP page to PDF or RTF.
However paragraph indentation (margin-left) is not coming correctly in RTF output(its all left aligned) but coming correctly in PDF output.Is there some limitation in RTF output?
Regards,
Kunalin reply to: Urgent -Bad pdf layout – it span only 1/4 of normal width December 22, 2011 at 13:11#28750Now I see what was the problem reason: I paid no heed to converter.adjustHtmlWidth() call.
It is better to remove both: converter.adjustHtmlWidth() and convert.fitPageVertically() until you have no special need in the features.
convert.fitPageVertically() tries to place all content to a single page. It does not reflow it, but just scales down content until it fit. If needed scale factors make text extremely tiny, it gives up. Obviously it happens with the document with your current configuration.
converter.adjustHtmlWidth() first renders page with given converter.setHtmlWidth() (virtual web browser frame width), after that calculates right content edge, sets htmlWidth parameter to the new value and re-renders the page. But if the page has an element with width=100% the approach does not work as the right content edge will be always equal to the initial converter.setHtmlWidth() value.
BTW: the code
if(landscapeView) converter.setHtmlWidth(1000); else converter.setHtmlWidth(PD4Constants.LETTER.width);
is not correct. As converter.setHtmlWidth() expects a parameter given in screen pixels, but PD4Constants.LETTER.width is a paper format in typographical points. Well, they are both integer values – hopefully you know what you do.
-
AuthorPosts
