Forum Replies Created
-
AuthorPosts
-
in reply to: JPG image type is unknown/unsupported June 10, 2015 at 12:42#29753
No my mistake : GIMP says it is “RGB color”
in reply to: JPG image type is unknown/unsupported June 10, 2015 at 14:00#29754Despite the file is named .JPG, it is in fact a BMP with 32-bit color. Adobe Photoshop cannot open it until the file is renamed to .BMP
For the time being PD4ML supports 1-, 8- and 24-bit BMPs. We’ll check what could be done with 32 bits.
in reply to: JPG image type is unknown/unsupported June 11, 2015 at 12:47#29755We’ve implemented 32-bit BMP support in the current development branch. The feature will be available with the forthcoming release.
in reply to: Troubleshooting June 12, 2015 at 08:18#27022Morning,
I’m testing out the use of watermarks within the page header but the image isn’t appearing. Any ideas why?header
As for watermarking an entire PDF, is there a suggested method? I’m using pd4ml.jar version prof.391.
Thanks,
Richardin reply to: General questions / FAQ June 12, 2015 at 12:09#27024Hi All,
could you please guide me to choose the best html width for pd4ml.
I could find the formula,
scale = (pageFormat.width – pageInsets.left – pageInsets.right) / htmlWidthIs the pageFormat.width 595 corresponds to 793 px? So if I have an inset of 10px, can I choose the html width as 773px, please help me to set this. Or is there any optimum html width for A4 ?
Can I set
pd4ml.setHtmlWidth(“773”);
Thanks in advance to all.
Regards
SarinTsin reply to: Optimum HTML width for A4 in pd4ml June 12, 2015 at 12:37#29758An “optimum” criteria differs depending on a use case. If you have an HTML document with a hardcoded table width=1000, by any htmlWidth less than 1000 the resulting document layout will be cut right side.
Let’s call the desired optimum is when 1pt defined in HTML corresponds to 1pt in PDF and in printed output. It can be useful if you need a correct font size (given in pt) conversion.
pageFormat is measured in physical units (pt)
pageInsets are also in pt
htmlWidth is in screen pixels
px/pt = 1.35
A4 width is 595pt(pageFormat.width – pageInsets.left – pageInsets.right) / htmlWidth = 1/1.35
htmlWidth = 1.35 * (pageFormat.width – pageInsets.left – pageInsets.right)
for A4:
htmlWidth = 1.35 * (595 – pageInsets.left – pageInsets.right)If the desired optimum is 1px defined in HTML corresponds to 1pt in PDF and in printed output.
htmlWidth = 595 – pageInsets.left – pageInsets.right
For landscape A4 orientation replace 595 with 842
#29750Hi!
First I would recommend to enable debug output and to inspect messages if it successfully to loaded the watermark image.
in reply to: Optimum HTML width for A4 in pd4ml June 12, 2015 at 12:44#29759thank you
in reply to: JPG image type is unknown/unsupported June 16, 2015 at 08:12in reply to: JPG image type is unknown/unsupported June 16, 2015 at 16:21#29757The new version is currently under QA. It is to be released tomorrow or day after tomorrow according to our plans.
in reply to: Troubleshooting June 16, 2015 at 19:03#27025We have an application using PD4ML to transform XML and export into PDF. There are issues when it requires SSL resources.
1. Some XMLs refers to remote SSL xsl file, for example:
2. Some xsl file refers to remote SSL image files, for example:
Here are some of our codes to generate PDF:
public void generatePdf(InputStream sourceStream, OutputStream targetStream, String headerText, boolean forcePrint) throws Exception {
PD4ML converter = new PD4ML();
if (headerText != null) {
PD4PageMark header = new PD4PageMark();
Font font = header.getFont();
Font boldFont = font.deriveFont(Font.BOLD);
header.setFont(boldFont);
header.setTitleTemplate(headerText);
converter.setPageHeader(header);
}
PD4PageMark footer = new PD4PageMark();
footer.setPageNumberTemplate(“Page $[page] of $[total]”);
footer.setPageNumberAlignment(PD4PageMark.CENTER_ALIGN);
converter.setPageFooter(footer);
converter.setPageSize(PD4Constants.A4);
converter.setPageInsetsMM(new Insets(10, 10, 10, 10));
converter.setHtmlWidth(820);
if (forcePrint) {
MapdynamicParameters = new HashMap ();
dynamicParameters.put(PD4Constants.PD4ML_PRINT_DIALOG_POPUP, “true”);
converter.setDynamicParams(dynamicParameters);
}
converter.render(new InputStreamReader(sourceStream, “UTF-8”), targetStream);
}The code couldn’t get HTTPS xlt file and couldn’t transform XML. Is there a workaround to solve it with PD4ML?
Thank you very much.
in reply to: absolute uri: http://pd4ml.com/tlds/pd4ml/2.6 June 17, 2015 at 09:09#29017I am having the same problem but every jar file is included.
in reply to: absolute uri: http://pd4ml.com/tlds/pd4ml/2.6 June 17, 2015 at 09:11#29018Forgot to include error message in Eclipse which is:
Can not find the tag library descriptor for “http://pd4ml.com/tlds/pd4ml/2.6”in reply to: absolute uri: http://pd4ml.com/tlds/pd4ml/2.6 June 17, 2015 at 15:24#29019http://pd4ml.com/tlds/pd4ml/2.6 in the context is not an URL, but an unique identifier of a JSP tag library (pd4ml_tl.jar).
If the JAR is correctly added to your web application it “registers” itself among application resources under the name.
If your application tries to unsuccessfully connect the URL, that means there is a webapp misconfiguration.
I would recommend to download the most recent version of PD4ML, install it and to make sure there is no old cached instances of pd4ml.jar in the working dir of the application etc.
in reply to: Convert XML to PDF with SSL resources June 17, 2015 at 16:26#29761From your problem description the usage scenario is not quite clear. Do you pass XML+XSL reference directly to PD4ML? In the case it should not work: PD4ML accepts as an input format HTML only (well, also SVG). Before a converting to PDF you need to transform the XML to HTML.
For a case it cannot load images/CSS by HTTPS:
PD4ML does not “officially” support HTTPS, however it implements very basic HTTPS resource loader (using the standard JDK classes). For example, WebSphere and Weblogic implement their own versions of HTTPS protocol, and the implementations are not derived from the standard API. That causes ClassCastExceptions on the platforms by attempts to load HTTPS resources.
In order to workaround such issues PD4ML supports so-called custom resource loaders.
pd4ml-html-css-pdf-tips-tricks-f7/a-definition-of-custom-resource-loaders-t40.html
If it is your case, you may implement your own HTTPS loader, utilizes Weblogic SSL classes. I’ve attached our standard SSL loader implementation, which could give you some implementation ideas.
-
AuthorPosts