Free Support Forum - groupdocs.com

HtmlHandler.GetPages returning only 2 pages

Hello,
I have recently updated from GroupDocs Viewer 17.12 to 18.5
I have it in a solution that I am debugging on Windows 10 using Visual Studio 2017. I have the code deployed to Windows Server 2012.

The following code only returns the first 2 pages of any pdf I give it. I want all the pages. It used to give me all the pages. How can I get it to do that again?

HttpPostedFileBase file = Request.Files[0];
Stream stream = file.InputStream;
byte[] attachmentData = attachmentData = new byte[file.ContentLength + 1];
stream.Read(attachmentData, 0, file.ContentLength);
ViewerConfig config = new ViewerConfig()
{
    CachePath = cachePath,
    EnableCaching = true
};
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.IsResourcesEmbedded = true;
htmlOptions.PdfOptions.EnablePreciseRendering = true;
htmlOptions.JpegQuality = 100;
htmlOptions.EnableMinification = true;
htmlOptions.ShowHiddenPages = true;
htmlOptions.PdfOptions.ImageQuality = ImageQuality.High;
List<PageHtml> pages = htmlHandler.GetPages(stream, adminPortalViewModel.FileName, htmlOptions);

@Chris_Miller,

Thanks for using GroupDocs.Viewer and sharing your issue with us.

GroupDocs.Viewer returns only first 2 pages (with some other limitations) when you use it in unlicensed mode. However, as you said that you were getting all the pages previously when using version 17.12, it seems that you are not eligible to upgrade the API to version 18.5 and your subscription was expired before the release of version 18.5.

Would you please check your subscription expiry date for confirmation? You can find the subscription expiry date in your license file by opening it in a text editor as shown here.