HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Licensing / Purchasing of PD4ML › PD4ML Evaluation License – Serial number?
- This topic is empty.
-
AuthorPosts
-
April 6, 2020 at 13:22#33899
Hi,
I have got a valid PD4ML Evaluation License but I can just produce blank PDF documents. Probably due to the license key.The manual says:
“Alternatively you may pass to PD4ML constructor a string with a serial number (obtained from the license email”)I haven’t got any license mail. But when logging in to the site I see my ”Activation key”, and my ”License number”, but I cannot find anything called ”serial number”. Passing activation key or license number in the PD4ML constructor do not help.
Could you please assist?
Best wishes,
Anders Westerberg, Gothenburg SWEDENApril 6, 2020 at 13:44#33900Hi Anders,
I am afraid it is not related to the license key. By an invalid or missing key it should still produce PDFs, but watermarked with an evaluation banner. Try with a minimalist “Hello, World!” HTML to make sure it works in general.
A blank page normally means the PDF is either corrupted by writing to a disk (file encoding issues etc) or the source HTMLis not parsed correctly (because of JavaScript, for instance)
April 6, 2020 at 14:28#33901Thanks for your prompt reply. Below my simple main method that generates a blank pdf document. Runing with java SDK 1.8.
public static void main(String[] args) {
try {
PD4ML pd4ml = new PD4ML();
String html = “<html><body>Hello World!</body></html>”;
ByteArrayInputStream bais = new ByteArrayInputStream(html.getBytes());
pd4ml.readHTML(bais);
File pdf = File.createTempFile(“result”, “.pdf”);
FileOutputStream fos = new FileOutputStream(pdf);
pd4ml.writePDF(fos);
Desktop.getDesktop().open(pdf);
} catch (InvokeException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}Getting some warnings as below during execution:
(evince:9270): Poppler-WARNING **: 16:25:30.061: Unsupported Annot Type
(evince:9270): Poppler-WARNING **: 16:25:30.061: Unsupported Annot Type
** (evince:9270): WARNING **: 16:25:30.061: Unimplemented annotation: POPPLER_ANNOT_UNKNOWN, please post a bug report in Evince issue tracker (https://gitlab.gnome.org/GNOME/evince/issues) with a testcase.
(evince:9270): Poppler-WARNING **: 16:25:30.061: Unsupported Annot TypeAll the best,
AndersApril 6, 2020 at 14:32April 6, 2020 at 14:39April 6, 2020 at 15:54#33905This thread can be closed. It works when compiling and running outside eclipse. Sorry for pestering you!
All the best,
AndersApril 6, 2020 at 16:49#33906Hmm… It seems the issue is JDK-specific. We experienced that before with OpenJDK older than v9 – for some reason it print typographical dash character instead of minus, which makes the PDF code invalid:
1.48148 0 0 ?1.48148 0 1 cm
0 ?1 1 0 0 0 cm
0 j
2 JWe implemented a workaround more than one year before, and the issue is not reproducible anymore on our side. It strange you still face with it.
Try the JVM parameter as suggested by one of our customers:
-Djava.locale.providers=COMPATDoes it change anything in your Eclipse environment?
-
AuthorPosts
You must be logged in to reply to this topic.