Hi, Support:
Here is a demand that some pages of a doc will be converted as pdf page, then the converted doc page will be removed from the document, finally, the converted doc pages will be replaced as the pdf pages, how to work it out by the dll?
Thanks for your help!
Ducaisoft
@ducaisoft
You can use Document.ExtractPages method to get the specified range of pages. This method returns Document object for extracted pages. Once you have desired extracted pages in the form of Document objects, you can use Document.AppendDocument method to join them.
Following code example shows how to extract first three pages of document.
Document doc = new Document(MyDir + "input.docx");
doc = doc.ExtractPages(0, 2);
doc.Save(ArtifactsDir + "Document.ExtractPages.pdf");
Thanks for your reply!
Maybe you misunderstand my question.
My issue is that the “Document.ExtractPages.pdf” will be then inserted at its original position, and the doc page will be removed and replaced with the “Document.ExtractPages.pdf” page.
How to work it out?
@ducaisoft
Please note that Aspose.Words mimics the behavior of MS Word. You can insert the PDF document in Word document as OLE.
To ensure a timely and accurate response, please attach the following resources here for our reference. We will then provide you more information about your query. Thanks for your cooperation.
- Your input Word document.
- Please attach the extracted PDF from the Word document.
- Please attach the expected output Word file that shows the desired behavior.
- Do you want to insert PDF as OLE or in the form of Word content?
PS: To attach these resources, please zip and upload them.