Embedded object in word getting lost while saving to PDF

Hi,


I am trying to convert a word document in to PDF . The word document has multiple embedded files in body . After saving the document in to PDF , the embedded files are getting lost .
The output PDF does not contain any embedded files which was present in source document .
Please let me know if this feature supported by this product .


// Load the document from disk.
Document doc = new Document(@“D:\Test.docx”);

dataDir = @“D:\Test.pdf”; //dataDir + “Template_out.pdf”;
// Save the document in PDF format.
doc.Save(dataDir);


I have attached both input and out put PDF for your reference . Please help .

Hi Subrat,


Thanks for your inquiry.

In this case, Aspose.Words mimics the way the Microsoft Word works. We converted your ‘Test.docx’ file to PDF format by using Microsoft Word 2016 and attached the resultant file (msw-2016.pdf) here for your reference. You can see that Aspose.Words 17.2.0 produces an output (see attached 17.2.0.pdf) similar to Microsoft Word. So, this seems to be an expected behavior. If we can help you with anything else, please feel free to ask.

Please also attach your expected document here for our reference. We will investigate the structure of your expected document as to how you want your final output be generated like. You can create expected document using Microsoft Word or any other application. We will then provide you code to achieve the same by using Aspose’s APIs. Thanks for your cooperation.

Best regards,

Hi ,


Thanks for the quick response . As per the requirement , we wanted to preserve the embedded object inside word document after converting in to PDF . For example I have one word document document having embedded files (“Embededfile1.xls”/ “Embededfile2.txt”) .
So after converting to PDF it should retain those embedded files.
And like now in word document if I click on “Embededfile1.xls”/ “Embededfile2.txt”
it opens up the document. So the same behavior should retain in final PDF after
conversion.
Please note the embed file inside original word document can be anything like pdf/word/excel/image/txt etc

Please let me know if this can achieved using Aspose .
Please find the attached word document that need to be converted to PDF and a sample file that show how would be the final PDF .



Hi Subrat,

Thanks for the additional information. We have logged your requirement in our issue tracking system as WORDSNET-14879. Our product team will further look into the details of this problem and we will keep you updated on the status of this issue. We apologize for your inconvenience.

Best regards,

Hi Subrat,


During investigating WORDSNET-14879, we have found that you can attach files to PDF document in viewer program, e.g. in Acrobat Reader. You should go to Comments -> Attach file. Then you should select file to attach and select icon. Please note that file can be opened only if you click on it with right mouse button, then open file command (or just double click on it). It differs from simple hyperlink. Not all viewers are able to open the attachment (e.g. Chrome can’t do it).

Can you please tell if this “embedding” is what you expect? Do you use or know any other program that has the feature (DOCX to PDF conversion with embedding files)? If yes, it would be nice if you please attach expected PDF document converted with such a tool. Thanks for your cooperation.

Best regards,
Hi Subrat,

We are waiting for your further input on this topic. Please share the required information for further proceedings. Thanks for your cooperation.

Best regards,

Hi,


Regarding WORDSNET-14879, our product team has completed the work on your issue and has come to a conclusion that they won’t be able to implement the fix to your issue because of insufficient shared information. Your issue (WORDSNET-14879) has now been closed with ‘Won’t Fix’ resolution.

Best regards,

Hi,

I too had this problem, but found the solution at last

  1. for proper format you may convert the embedded objects (PDF’s, Word,Excels) in policy as a link but after converting it to PDF it shows as image but format remains same means name which you want.

  2. Upload all the files(password protected-UN-editable) which you want to link in policy(encrypted) to your google drive and give permissions to everyone who has this link.

  3. open converted PDF (Policy Document or any) in Adobe Acrobat DC or Any Adobe PDF Editor then right-click on the Icon or document which you hyperlinked in the root policy document then click -> create link and select invisible rectangle -> then at left bottom click open web page and click ok then it popups url space then go to your google drive where you saved all your supporting documents for this policy then right-click on the particular document you wanted to link and get shareable link copy it and paste in the URL space in pdf editor and click ok and save the document :slight_smile: now your policy with embedded documents will work in pdf mode also. Enjoy bro… I just searched about same issue so i found yours too so am posting this now may be you already sorted out … if not am happy that i solved yours tooo…

@KRISHNAPAVAN_YNV,

Thanks for the additional information which may help other developers who are facing the same problem and it is great you were able to find what you were looking for.