Skip to main content
Participant
February 22, 2023
Answered

Adobe API: combine .docx file with .pdf file

  • February 22, 2023
  • 1 reply
  • 834 views

Hi,

I am using the Adobe API for .net.

I have 2 files (file1.docx & file2.pdf) and I need to merge both output to pdf file(file3.pdf) programmatically.

Using createPDFOperation, I know how to convert file1.docx to file1.pdf file. Later, I can use the combineFilesOperation to combine file1.pdf + file2.pdf = file3.pdf.

However, by following this process, I am creating file1.pdf which I will be discarding any way. Only reason I am creating file1.pdf is to combine both files. Not sure you can combine docx and pdf files in same operation. I tried and it did not work.

I am not sure if this is the right approach and hence, I am reaching out to the community to know if there is any other alternate approach.

Thanks in advance.

Regards,

Chocks

This topic has been closed for replies.
Correct answer Joel Geraci

At this time you will need to convert the .docx and then combine in two separate operations. The SDKs make this pretty easy though. You can pass the FileRef output of one service to the input FileRef of the next without having to actually save it.

1 reply

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
February 23, 2023

At this time you will need to convert the .docx and then combine in two separate operations. The SDKs make this pretty easy though. You can pass the FileRef output of one service to the input FileRef of the next without having to actually save it.

Participant
February 27, 2023

Hi Joel,


Thanks for the response.
Yes, I passed FileRef to AddInput method in CombineFilesOperation class and it worked.
So now I am not saving the file to disk.

Regards,

Chocks