I have written a code which utilizes Word Automation Service in order to convert the .DOCX file to the .PDF. I have noticed that in case the Word document contains a table of contents, its links are removed in the PDF. This is very bad for my business case.
On the other hand, manually opening MS Word and saving the same document as PDF preserves the links in the table of contents. This is the behavior I am looking for, but I want to keep my code independent form having MS Office Word installed on the machine running my code.
Has anyone had the similar issue and was anybody able to resolve it?
In my case, i found out that this is something related to Job Settings property. Try to comment or remove this line of code if you have one:
jobSettings.UpdateFields = true;
Related
I need to perform multiple edits in a word document and based on search criteria then import the relevant PDF for that specific page. The file path I dynamically create as per specific data on the various pages. The code works fine if there are less that roughly 70 PDF files to import.
Once it gets to importing after around 70 PDF files then Word starts to give warning about not being able to undo the action which is about to be performed, even though i clear the Undo History after I have imported each PDF.
Then there is also an error which comes up with regards to the importing of the PDF, see image below:
But I can still open PDF document when this error occurs, if I stop my code and try to manually import the PDF it doesnt work. Only if I save the word document and then reopen it, can I import PDF documents into the word document again.
I believe it has something to do with all the actions being performed in Word.
Unfortunately I am not able to create a demo code which will give the same outputs for this question.
Why would PDF documents give an error when importing into Word?
I'm creating a program which extracts a docx file, displays it in a Javafx graphic interface with buttons in place of flags put in the docx, and when one puts on it, it modifies the docx taken in input.
I'm using the docx4j API for extracting and modifying the document.
The problem is that the program fails if i take in entry a docx generated from Microsoft Word. I'm forced to use an artifice.
I'm taking my docx made on Word, then i load it in Google Docs and I use the "Download in .docx format" option. If i directly put the docx from Word in my program, it fails.
I noticed my Word file was two times lighter after being passed trough google doc. Same, if I tale a docx file downloaded from Google Docs, if i open it in Word and modify one letter and save it, he becomes two times heavier. For the record i use word 2008.
That's it, so I'd like to know if someone know what explains this difference.
Thanks
I have a Microsoft word document with 58 pages when I generate pdf file with word itself or doPDF or other softwares, they generate pdf file with 61 pages. How can I solve this problem.
My document written in Persian language.
Word loves to reformat the document whenever something is changed in the printer settings (such as selecting another printer). You might make sure that you have the printer driver used for doPDF active when you edit the document, and invoke the Print command.
You may also make sure that the page sizes selected in the print dialog correspond to the one of the document.
You can also, make sure that you have written the document using word's ability to end (break pages) that way you will make sure that the pages you have are not moving, especially the figures.
This is not a back-end programming question. I can only modify the markup or script (or the document itself). The reason I'm asking here is because all my searches for appropriate terms inevitably lead to questions and solutions about programming this functionality. I'm not trying to force it via progrmaming; I have to find out why this PDF is behaving differently.
So:
I have a bunch of links to PDFs on a page. Most of them open in new tabs, but one of them, the most recent, starts to open in a tab, but then the tab closes and the PDF gets downloaded as a file instead. All markup is consistent - there's nothing differnt about the odd-man-out except the actual URL.
You can see this here:
http://calwater.mwnewsroom.com/Investor-Relations/Financial-Reports/Annual-Reports
All annual reports up to 2012 open in a new tab, but 2013 downloads instead.
This leads me to believe that there is some meta-data property of the PDF itself that tells it how to open, and that, in this case, the 2013 PDF was created using different settings.
Apparently, the PDF was saved out to PDF from InDesign.
Does anyone have any insight?
Problem solved. There was simply an error in the string (like an extra period) that references the attachment such that it couldn't tell it was a PDF. Fixing the reference fixed the problem.
I somewhat inherited a form application that I'm tweaking.. Long story short I merely want a read only view of a word document. I don't want the overhead of launching Word so I thought maybe just a print style preview. I somewhat need to stay away from 3rd party apps so I'm limited. Anyways.. I'm trying to handle pdf's, txt's, image files and word docs. The problem is that I can't seem to load the print preview. I can print it.. but no see it in the PrintPreviewController that I added. Anyone have an example? I'm trying to be careful w/ overhead because I'm already running 5+ stored procs to retrieve info for this prototype.
Anyone? My examples are nasty.. but if you want to see I'd be glad to supply..\
Now I gave a shot to using a Webview and it launches rather in the MS Word application itself.. I see documents on registry tweaks needed.. ugh..
I think you may as well use Word. Check your Task Manager Process list - printing the word document will start up an invisible instance of Word anyway.