We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Export a particular page from word to pdf

Hi,

I want to convert a particular page of MS Word file to pdf.
Lets say I have a doc file having 20 pages and I want to export 10th page as PDF file.

Is there any APIs available in ASPOSE for Java which can accomplish this task?

Any help would be much appreciated.

Hi Tejas,

Thanks for your inquiry.

Sure you can achieve this by using the PdfSaveOptions class and passing this when you save your document. Please see the code below.

PdfSaveOptions saveOptions = new PdfSaveOptions();<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

saveOptions.setPageIndex(9);

saveOptions.setPageCount(1);

doc.save("Out.pdf", saveOptions);

Thanks,

Hi Adam,

Thanks a lot for your reply.

That’s exactly what I want.
Appreciated …

Hi Adam,

Is it possible to export a page from doc file to JPEG image?

Hi Tejas,

Thanks for you request.

I'm afraid rendering to image is only avaliable in Aspose.Words for .NET at the moment. This functionality has to be implemented manually on Java so it is taking extra time.

I have linked your request to the appropriate issue, you will be informed as soon as rendering to image in Java is ready. Please expect a response within 2-3 months.

Thanks,

Thanks for the reply Adam.

Do we have any other way to achieve the same. Like word to PDF & PDF to JPEG?

Hi Tejas,

Thanks for this additional information.

Yes, I believe it is possible right now by converting the document to PDF using Aspose.Words and then extracting each page from the PDF as a JPEG using Aspose.Pdf.Kit. You may need to verify if this is possible with Aspose.Pdf.Kit team here.

If you have any further queries, please feel free to ask.

Thanks,

The issues you have found earlier (filed as WORDSJAVA-20) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(2)