Free Support Forum - groupdocs.com

How to get page count after converting to Pdf?

Hi,
I am using GroupDocs.Conversion to convert files to PDF.
Is it possible to have the page count of resulting Pdf?

Thanks.

Hello,

Thank you for giving a try to the new GroupDocs.Conversion API.


You can convert and save specific range of pages, please have a look at this PdfSaveOptions properties.

// Document Save options in Version 3.1.0
SaveOptions saveOptions = new PdfSaveOptions
{
PageNumber = 1, // Convert from page number
NumPagesToConvert = 10, // Number of pages to convert
Dpi = 300, // Page images quality
Width = 1024, // Page width
Height = 768 // Page height
};

// Returns the converted spreadsheet Pdf as IO Stream.
var convertedDocumentStream = conversionHandler.Convert("Sample.pdf", saveOptions);


Please find below some useful resources for GroupDocs.Conversion API (3.x.x).


If you will need any help or you will have any other questions please feel free to ask.


Warm Regards,

Muhammad,
Thanks for answer. But the problem is that I don’t know the page count of Pdf in advance. I leave NumPagesToConvert and conversion works fine. But I want to get page count after document gets converted into Pdf.

Hello ,

Thank you for the sharing detailed information ,

we are sorry to inform you that this feature is currently not available in our Library but as you need it and its a promising feature so we have informed our Product Team about this feature and we hope this feature will be available in upcoming release soon.

If you will need any help or you will have any other questions please feel free to ask.

Warm Regards,