Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Jun 16, 2023 2:34 pm

Hi, in my .NET project, I had installed the Spire.PDF 9.6 from NuGet in Visual Studio today.

I am building a .NET application to be used within company staff.
What I want is to load a pdf which scanned from a scanner with multiple pages. I want to loop through the pages and get the pages to be converted into images.
I want to know if the free version of Spire.PDF can manage to do it's work or not.

I read this from your website saying:
Free version is limited to 10 pages of PDF. This limitation is enforced during loading and creating files. When converting PDF to Image, the first 3 pages of PDF files will be converted to Image format successfully.

So, does that mean free version is restricted to only load 10 pages from pdf and only 3 pages can be converted into image?

My question is, why I am allow to load 19 pages of pdf, and for each page I can create the image (19 of them) without problem?

Is it because I run under some kind of evaluation license before expiration? (I don't remember I do anything beside downloading from nuget)

This is my code:

PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(fi.FullName);

// my pdf has 19 pages
for (int i = 0; i < pdf.Pages.Count; i++)
{
PdfPageBase page = pdf.Pages[i];

// it is going to be 1 image only per page because this is from scanner
Image[] images = page.ExtractImages();
foreach (Image image in images)
{
// image processing here
}
}

I want to know if I will hit any exception and any error during my processing of the 19 pages pdf and also create the 19 images.
I am totally fine with the red color watermark on each of the 19 image due to it is free version.
I just wonder why am I not hitting any of the error.

Thanks.

wensan312
 
Posts: 2
Joined: Fri Jun 16, 2023 1:41 pm

Mon Jun 19, 2023 6:08 am

Hello,

Sorry for the late reply due to the weekend.
Based on the information you provided, I simulated a PDF document with more than 10 pages, and the error message during conversion is as follows:
re.jpg

The Spire.PDF 9.6 you downloaded from NuGet is our commercial version, not the free version. The commercial version of Spire.PDF can convert PDF files with more than 10 pages. Without a license, only the first 10 pages contain content, and a red color watermark will be added to the output files.

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Mon Jun 19, 2023 7:51 am

Hi Zhang, thanks for your response.
My intention is not to save to other format, so that's not the issue for me.

My only objective is to extract the images only for a PDF which has more than 10 pages.
May I know if my code will work with the Commercial without license?
Will I hit any error or exception at:
1) LoadFromFile() or
2) access to pdf.Pages[i] with i greater than 10
3) or the page.ExtractImages();

My code:
private static Image[] GetImages(string pdfFile)
{
var imageList = new List<Image>();
var pdf = new PdfDocument();

pdf.LoadFromFile(pdfFile);

if (pdf != null)
{
for (int i = 0; i < pdf.Pages.Count; i++)
{
var page = pdf.Pages[i];

if (page != null)
{
var images = page.ExtractImages();

if (images != null && images.Length > 0)
{
imageList.AddRange(images);
}
}
}
}

return imageList.ToArray();
}

Thank you very much.

wensan312
 
Posts: 2
Joined: Fri Jun 16, 2023 1:41 pm

Mon Jun 19, 2023 9:10 am

Hello,

Thanks for your inquiry.
According to the information you provided, your operation is just to get the images in the PDF document, which does not involve any conversion using our product, so there are no restrictions on this operation. Only when using our product for operations (such as PDF to image conversion) will there be a limit on the number of pages. Therefore, for your question, there will be no problem when executing the three operations you mentioned.

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Return to Spire.PDF