Issue with PDF Loading in Latest Doconut Update

Dear Doconut Support Team,

In the latest update of Doconut, I encountered an issue when trying to load a PDF file in the annotation page:
https://try.doconut.com/annotations.aspx.

I have tested multiple approaches including:

  • Loading from a local file path
  • Loading from a byte[]

Unfortunately, I still receive the same error in both cases.
Please find the attached screenshots for your reference.
image.png (3.6 KB)

Could you kindly advise on how to resolve this issue?

Best regards,

@odaysaed

Thank you for reporting this issue. To assist you better, could you please confirm which version of Doconut for .NET Framework you are currently using?

Additionally, it would be very helpful if you could provide us with a small sample project that replicates the error you are experiencing. This will allow us to reproduce the problem in the same environment and provide you with a more accurate solution.

Looking forward to your update.

Dear @ [gabriel.vega],

Thank you for your response.

I am currently using Doconut for .NET Framework 4.8 (WebForms). From your source code package, I used the WebForm Example (Full) folder as the base.

The issue occurs when I try to load a sample file. Initially, it was set to sample.ppt, but I replaced it with a PDF file, and that is when the problem appeared.

Please let me know if you need me to share the modified project for further debugging.

Best regards,

namespace Full
{
    public partial class Annotations : System.Web.UI.Page
    {
        private string documentToView = "~/files/Sample.pdf";

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string token = ctlDoc.OpenDocument(Server.MapPath((documentToView)));

                if (token.Length == 0)
                {
                    ShowInternalError();
                }
            }
        }

@odaysaed,

Thank you for the additional details. We are currently investigating the issue you mentioned.

If possible, could you please share a simple sample project in ZIP format that reproduces the problem? Having a minimal reproducible example will help us replicate the behavior on our side and speed up the debugging process.

@odaysaed

Thank you again for your patience while we reviewed this behavior.

We were able to reproduce the issue. The cause is related to how the viewer applies its default configuration internally. Normally, the OpenDocument method can take an optional configuration object that inherits from BaseConfig (for example, PptConfig, PdfConfig, or ExcelConfig). In the current version, this config does not occur correctly.

Workaround:
For now, you can explicitly pass the right configuration object as a parameter to the OpenDocument method depending on the file format (e.g., new PdfConfig() when loading PDFs). We also recommend it as best practice, since it allows you to configure other options such as resolution, render engine, and additional settings as needed.

Our team has already fixed this, and the improvement will be included in the next release so that the configuration is applied automatically.

We have also attached a simple sample project (WebForms, Annotations page) where PDF loading works correctly. You can use it as a reference until the fix is released.

odaysaed-Annotations.zip (1.1 MB)