Free Support Forum - groupdocs.com

Error with UseHtmlBasedEngine png option


#1

Hello Team,



I am testing Viewer with the attached 20MB pdf document, but it fails with the attached error. Can you please help?

Btw, execution is successful if I use default parameters instead of .UseHtmlBasedEngine(true, true, false, false)






.TargetElementSelector("#test")

.Stream(ms, id.ToString(), extension, name, false, null)

.EnableRightClickMenu(false)

.ShowThumbnails(false)

.OpenThumbnails(false)

.ZoomToFitWidth(false)

.Width(1200)

.Height(900)

.DownloadPdfFileIfPossible(false)

.UseHtmlBasedEngine(true, true, false, false)

.ShowDownload(false)

.SupportTextSelection(false)

.ShowFolderBrowser(false)

.ShowHeader(false)

.ShowPaging(false)

.ShowViewerStyleControl(false)

.UseVirtualScrolling(false)

%>


#2

Hello,


We are really sorry to hear that you faced with this issue. This is a known bug which will be fixed very soon. Meanwhile please try to use this version of the Viewer . With this version your document rendered well.

Sorry for the inconvenience.

#3

Hi Pavel,





I tried with 2.14.0.0 version of dll but with no luck.

Bellow are error details captured in log.txt:





Local time:08/25/2015 11:10:06, UTC time:08/25/2015 09:10:06 Starting saving a stream to 5bce342e-c269-413b-80c8-3e6bff5995fe

Local time:08/25/2015 11:10:07, UTC time:08/25/2015 09:10:07 Result file path: temp\S\5bce342e-c269-413b-80c8-3e6bff5995fe.pdf

Local time:08/25/2015 11:10:07, UTC time:08/25/2015 09:10:07 Stream downloaded successfully

Local time:08/25/2015 11:10:09, UTC time:08/25/2015 09:10:09 ViewDocument

Root Storage Path:D:/Temp/

Processing Folder Path:

Document Path:temp\S\5bce342e-c269-413b-80c8-3e6bff5995fe.pdf



Local time:08/25/2015 11:10:16, UTC time:08/25/2015 09:10:16 Exception

Root Storage Path:D:/Temp/

Processing Path:

Local time:08/25/2015 11:10:16, UTC time:08/25/2015 09:10:16 System.ArgumentException: Parameter is not valid.

at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)

at .š‰…ctor(Int32 , Int32 , Single , Single , PixelFormat )

at .š‰…ctor(Int32 , Int32 , Single , Single )

at .š‰…ctor(Int32 , Int32 )

at –.—.œ(›‰ , š‰ )

at –Ÿ.aŠ.(›‰ , Dictionary2 ) <br /> at ..‰(Œ ) <br /> at ..‰(Œ ) <br /> at .Œ.Convert(List1 , Œ , ‘ )

at ƒ.„.Convert(String , ‚ , IList1 , a , ˜‰ ) <br /> at š..“(Document , String , Stream , HtmlSaveOptions ) <br /> at Aspose.Pdf.Document.Save(String outputFileName, SaveOptions options) <br /> at ..() <br /> at ..(String path, FileType type, options) <br /> at a..(String path, FileType type, options) <br /> at ..(String filePath, Func2 htmlWithImageCreator, String prefixForResourceUrlsInHtml, String prefixForResourceUrlsInHtmlFiles, Nullable1 firstPageParam, Nullable1 pageCountParam, Boolean generatePagesToEndOfDocument, Boolean usePngImagesForHtmlBasedEngine, Boolean convertWordDocumentsCompletely, Boolean ignoreDocumentAbsence, Boolean saveToCustomTempStorage, Boolean supportListOfContentControls, Boolean supportListOfBookmarks, Boolean embedImagesIntoHtmlForWordFiles)

at Groupdocs.Web.UI.Handlers.BaseHandler.(IUrlsCreator urlsCreator, printableHtmlCreator, String guid, Boolean useHtmlBasedEngine, Boolean usePngImagesForHtmlBasedEngine, Nullable1 count, Nullable1 width, Nullable1 quality, Boolean usePdf, Nullable1 preloadPagesCount, Boolean convertWordDocumentsCompletely, String fileDisplayName, String watermarkText, Nullable1 watermarkColor, WatermarkPosition watermarkPosition, Single watermarkWidth, Boolean ignoreDocumentAbsence, Boolean supportPageRotation, Boolean supportListOfContentControls, Boolean supportListOfBookmarks, Boolean embedImagesIntoHtmlForWordFiles, String callback, String instanceId, String locale) <br /> at Groupdocs.Web.UI.Controllers.GroupdocsViewerController.ViewDocument(String guid, Boolean useHtmlBasedEngine, Boolean usePngImagesForHtmlBasedEngine, Nullable1 count, Nullable1 width, Nullable1 quality, Boolean usePdf, Nullable1 preloadPagesCount, Boolean convertWordDocumentsCompletely, String fileDisplayName, String watermarkText, Nullable1 watermarkColor, WatermarkPosition watermarkPosition, Single watermarkWidth, Boolean ignoreDocumentAbsence, Boolean supportPageRotation, Boolean supportListOfContentControls, Boolean supportListOfBookmarks, Boolean embedImagesIntoHtmlForWordFiles, String callback, String instanceIdToken, String locale)

at lambda_method(Closure , ControllerBase , Object[] )

at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) <br /> at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters)

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.b__33()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.b__36(IAsyncResult asyncResult)

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.b__20()

at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.b__22(IAsyncResult asyncResult)


#4

Hello Deric,


Thank you for these details. Could you please if possible share with us example of your project that we can check and fix it for you.

Thank you.

#5

Hi Pavel,



You can access example project at https://drive.google.com/file/d/0ByZC1UqGlDWbdzF4SDVvaWs0dTQ/view?usp=sharing



Please add a valid licence file, since I removed it from project. Attached are screenshots of error. Using same code and different pdf is not resulting in error.



Without license, only first page of document is generated, as expected, so please use a valid licence in project in order to replicate the issue.



Thank you!


#6

Hello Denic,


Thank you for the example. Yes, now I was able to reproduce the issue. We have created a bug ticket (you can see it attached to the first post) and our product team will resolve it. Whe fixed version will be ready you will be notified here.

Sorry for the inconvenience.

#7

Thank you for the quick response, Pavel! Yes, I can see the issue is logged as WEB-1966. Looking forward to the solution/new cut.


#8
Hi,

Sure, I will keep you updated.

Best regards.