HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Technical questions / Troubleshooting › Attachments in Evaluation Mode
- This topic has 5 replies, 2 voices, and was last updated Sep 08, 2023
15:08:38 by bernd.ries@myosh.com.
-
AuthorPosts
-
September 6, 2023 at 06:35September 6, 2023 at 11:53#37086
Hi! Is it reproducible only in a particular Web browser or it appears like that also in Acrobat Reader?
Could you please share with us a minimalistic PDF sample to illustrate the issue?September 6, 2023 at 13:31#37087Hi,
attached is a sample, the attachment only opens in Acrobat Reader; It is not in Edge, Chrome and Safari don’t.
This is how I attached the file, it’s straight from the example from the pd4ml documentation.
pd4ml.injectHtml(“”
+ “<pd4ml:attachment style=\”align: right\” type=\”paperclip\” description=\”test-image.jpg\” src=\”c:\\temp\\test-image.jpg\”/>”
+ ““, false);
Is there a way to make this work in web browsers?
Thanks
BerndAttachments:
You must be logged in to view attached files.September 7, 2023 at 01:53#37089This is the full code used for above pdf:
PD4ML pd4ml = new PD4ML();
pd4ml.applyLicense(“xxxxx”);
pd4ml.setAuthorName(“yyyyy”);
pd4ml.setDocumentTitle(“zzzzz”);
pd4ml.enableHyperlinks(false);
pd4ml.setHtmlWidth(1000);
//authenticate
pd4ml.setHttpOptions(null,”user:pwd”);// add attachments
pd4ml.injectHtml(“”
+ “<pd4ml:attachment style=\”align: right\” type=\”paperclip\” description=\”test-image.jpg\” src=\”c:\\temp\\test-image.jpg\”/>”
+ ““, false);
// get html
pd4ml.readHTML(new URL(“https:aaaaaaaaaaaaaaaa/02E1B2F?OpenDocument”));
// write pdf
File pdf = new File(“c:\\temp\\000018.pdf”);
FileOutputStream fos = new FileOutputStream(pdf);
// render and write the result as PDF
pd4ml.writePDF(fos);September 8, 2023 at 11:43#37103We need time to investigate. A few years ago, built-in PDF viewers in web browsers did not support PDF annotations at all (technically, a PDF attachment is a type of PDF annotation). There is partial support now, but it appears that Acroread is still the only reliable way to work with PDF attachments.
September 8, 2023 at 15:08#37104Thanks,
that’s alright, no pressure.
We have a workaround and will not include attachments for now, but it would be great if attachments work in web browsers.Thanks
Bernd -
AuthorPosts
You must be logged in to reply to this topic.