Posted 12 September 2019, 4:12 pm EST - Updated 29 September 2022, 11:15 pm EST
I’m using the following code for converting PDF pages to an image (from the documentation - see attached)) and getting an error "Unlicensed copy of GrapeCity Documents for Imaging. The number of GcBitmapGraphics (BitmapRenderer) and GcWicBitmapGraphics (RenderTarget) instances is limited to 10. Contact us.sales@grapecity.com to get your 30-day evaluation key.
We purchased a license for Documents for PDF and do not want to also purchase a license for Imaging.
Here’s a copy of the code:
GcPdfDocument doc = new GcPdfDocument();
var fs = new FileStream(newFilePath, FileMode.Open, FileAccess.Read); doc.Load(fs); numOfPdfPages = doc.Pages.Count(); SaveAsImageOptions saveOptions = new SaveAsImageOptions() { BackColor = Color.White, DrawAnnotations = false, DrawFormFields = false, Resolution = 100 }; newFilePath = newFilePath.Replace(".pdf", ".jpg"); doc.Pages[0].SaveAsJpeg(newFilePath, saveOptions); thumnailUrl = Path.Combine("/opportunitySubmissions/", filename.Replace(".pdf", ".jpg")); for(int pgCnt = 0; pgCnt < numOfPdfPages; pgCnt ++) { string tempFilePath = newFilePath.Replace(".jpg", "_" + pgCnt + ".jpg"); doc.Pages[pgCnt].SaveAsJpeg(tempFilePath, saveOptions); }