Free Support Forum - groupdocs.com

Viewer does not show drawing in pdf using C#

Hello,

I have a pdf with a drawing but the viewer does not show it at all. Did I miss something? (I attach a pdf file with this problem).

I use the latest version of groupdocs viewer (20.7) and the code is very simple:

using (Viewer viewer = new Viewer(@"Docs\TestDrawingPdfW.pdf"))
            {
                string filePathFormat = "pagePdf-{0}.html";
                HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(filePathFormat);
                viewer.View(options);
            }

ThanksTestDrawingPdfW.Pdf (39.4 KB)

1 Like

@oorduz

This issue is reproduced at our end. Output.zip (27.1 KB) HTML lacks the drawing. We have logged this scenario in our internal issue tracking system with ID VIEWERNET-2690 for further investigation and resolution. You’ll be notified as there’s any update.

@oorduz

We have an update on VIEWERNET-2690. In order to get rid of this issue please enable rendering comments ViewOptions.RenderComments = true;. As the comment rendering is disabled by default. In the case of PDF documents comment (annotation) could be anything (field, drawing, etc.). We’ll further investigate this issue and resolve it in some upcoming release of the API. But for now when rendering PDF documents, enable comments rendering as it shown the following code snippet:

using (Viewer viewer = new Viewer("TestDrawingPdfW.Pdf"))
{
    HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();
    viewOptions.RenderComments = true;
    viewer.View(viewOptions);
}

Have a look at the output.png (184.0 KB) generated by setting RenderComments to true.

Hello @atirtahir3

It works like a charm !!!

Than you very much

1 Like

@oorduz

You are welcome :slight_smile:

The issues you have found earlier (filed as VIEWERNET-2690) have been fixed in this update. This message was posted using Bugs notification tool by atirtahir3