cfdocument not converting Word Document to PDF correctly - pdf

cfdocument in ColdFusion 11 is not converting my Word Documents to PDF correctly. I have OpenOffice 4.1.3 installed and configured in CF Admin. I am able to open the source document in OpenOffice and Export to PDF without issue. However, when I run the following code, the resulting PDF is "gobbledigook":
<cfdocument
format="pdf"
srcfile="#_tempSourceFilePath#"
filename="#_destinationFilePath#" />
Here is an excerpt of the resulting PDF (the snip shows developer edition, but, the same thing happens with Standard installation):
I can't figure out why this is happening. Any ideas?

The problem is:
srcfile="#_tempSourceFilePath#"
This is apparently the path to a binary file that is not browser-writable. A necessary condition for the srcfile attribute is that the file be browser-writable. That is, without the need for a browser plugin.

Related

Add link to PDF within a PDF file using relative addressing

I want to add a link to some text within a PDF that will bring up another PDF that is located in the same folder. I wish to use relative addressing so that the PDF suite is transportable to other users and computers. I wish this to work on Linux and Macs.
LibreOffice Draw, despite promises, writes out the link address as a full path. Thus if taken to another computer with another user the link fails to work.
I tried manually editing the PDF files using vi and altered the link syntax so;
<</Type/Annot/Subtype/Link/Border[0 0 0]/Rect[940.9 480.3 1200.7 507.9]/A<</Type/Action/S/URI/URI(Content/Information.pdf)>>
where the target file, "Information.pdf" is in a subdirectory "Contents".
On Linux using Document Viewer, it works! On an Apple, Preview (a PDF viewer) interprets the target file needs to be opened by some application. Adobe Reader doesn't like this syntax either. I tried prefixing the filename with the keyword "file:" which works for a full path but not with relative addressing.
Does anyone know what syntax might work for me
Editing a PDF you can select text and add a hyperlink using LibreOffice Draw. It is then possible to edit the PDF file with a text editor such as vi.
To find the line with the link search for the filename of the target. One problem is that LibreOffice insists in using a fully qualified domain name to locate the file and this won't work after the file is moved, say to another computer. The unedited line should be similar to;
<</Type/Annot/Subtype/Link/Border[0 0 0]/Rect[940.9 480.3 1200.7 507.9]/A<</Type/Action/S/URI/URI(File:<fullpathname>/Content/Information.pdf)>>
Where Content/Information.pdf is the link target in the same directory as the linking pdf. This line should be changed to
<</Type/Annot/Subtype/Link/Border[0 0 0]/Rect[940.9 480.3 1200.7 507.9]/A<</Type/Action/S /Launch/F(Content/Information.pdf)>>
This works on Unix and MacOs

Broken hyperlinks when converting .docx files to PDF via LibreOffice

I'm attempting to convert .docx files to .pdf via soffice, using the following command:
soffice --convert-to pdf input.docx --outdir <outdir>
The conversion succeeds without any error. However, the hyperlinks do not work. The hyperlinks in the file are relative links to other PDF files in the same directory.
The hyperlinks do not work - no matter what PDF reader I use, the hyperlinks aren't clickable.
I tried the following to narrow down my issue:
Open the document in LibreOffice and “edit” the first hyperlink, open and close the dialog without doing anything.
Save the .docx file in LibreOffice, and then run the headlesss conversion CLI via soffice.
Observe that only the first hyperlink works - the one we “edited” without changing anything.
I opened the actual .docx internals, and found the _rels files were exactly identical. The only difference was that the hyperlink I “edited” had this additional tag in the word/document.xml:
<w:rStyle w:val="InternetLink" />
Some googling me found this unanswered issue. It appears that LibreOffice expects the InternetLink property to be present when converting hyperlinks to pdf.
My question is - how can I use soffice to convert the .docx to .pdf while retaining hyperlinks? Is there a code change I can make to the LibreOffice source code?

ExpertPdf - how to generate pdf with marking text possibility from HTML

I'm using ExpertPDF library to generate PDF. I had the same code on two different servers. On one of them PDF was generated as a text (I could mark text in pdf and copy). On the second server PDF was generated as a picture, so I couldn't mark text in PDF file.
What is the differenc? Where should I looking for an error?
Now, after installing windows updates on all servers PDF is generateing as a Picture. I think, that updates had main influence on that change, but I'm not shure.
I had this problem too, with an older version of ExpertPdf that used IE for rendering. The problem is fixed in the last version (v9) that does not rely on IE anymore.

LiveCycle Font not rendering properly

I have installed Adobe LiveCycle ES4 using Default Settings on my system and i am using the GeneratePDFService for converting a URL to PDF.
The Logic is working properly but the problem is in the output PDF which is generated after conversion, the problem is, here in we are using Marathi Font, but after conversion only the Numerals/Numbers are displayed properly in Marathi in the PDF generated, instead of the whole Page.
in the page, we have used CSS font-face reference too and also tried implementing the font inline, but of no use.
The font used too is installed in the Windows\Fonts Folder.
Looking for favorable replies.
Thanks
I don't know the exact reason as I was using these services, it was working.Anyway I have a solution. For chrome ie and ff you can install save as pdf(webpage save as pdf) services.you can check for browser plugins or extensions for this.This will help you.For ie i think already a save as pdf feature is available.

Convert .mht files to pdf files using java

Is it possible to convert MHTML(.mht) files to pdf with proper css rendering.
Tried using pd4ml but the extenal css and links refered in .mht file fails to get loaded in the pdf genrated.
You could try unpacking the MHTML to HTML and separate files, then using your pd4ml method to generate the PDF.
Chilkasoft Java MHT is one solution you can look into, although after the 30 day trial you will need a license.