Possible bug/problem with the tag attributes

Posted by: simona.fratus on 14 September 2023, 6:40 am EST

    • Post Options:
    • Link

    Posted 14 September 2023, 6:40 am EST

    Hi,

    I’m testing the library for an accessibility project and initially I was using an older version (5.1.0.793) but now I switched to the last version 6.2.2 and I’m having some problems with the PDF accessibility checker (PAC).

    To be more specific I had an image with the figure tag and a couple of attributes:

    StructElement seImage = new StructElement("Figure") { DefaultPage = lpage };
    Attr thAttrBBox = new Attr();
    thAttrBBox.Properties.Add("O", "Layout");
    thAttrBBox.Properties.Add("BBox", new float[] { ip.X, ip.Y, l, h });
    seImage.Attrs.Add(new AttrRevision(thAttrBBox, 0));

    Changing the version, since there is no more Properties I changed the code into:

    StructElement seImage = new StructElement("Figure") { DefaultPage = lpage };
    Attr thAttrBBox = new Attr();
    thAttrBBox.PdfDict.Dict.Add(new PdfName("O"), new PdfString("Layout"));
    thAttrBBox.PdfDict.Dict.Add(new PdfName("BBox"), new PdfArray(new float[] { ip.X, ip.Y, l, h }));
    seImage.Attrs.Add(new AttrRevision(thAttrBBox, 0));

    Now the SR still read the PDF in the right way, but when I try to load the PDF on PAC (or on https://check.axes4.com/en/) there seems to be some kind of error. PAC announces a System.InvalidCastException.

    Am I doing something wrong or there is some kind of bug?

    Kind regards,

    Simona

  • Posted 15 September 2023, 4:51 am EST

    Hi,

    Thanks for reaching out to us.

    Could you please provide a stripped sample replicating this behavior? So, that we can investigate and assist you accordingly.

    Best Regards,

    Nitin

  • Posted 15 September 2023, 8:45 am EST - Updated 15 September 2023, 8:50 am EST

    TestGrapecity.zip

    Hi! If you run the project with VS you will obtain a pdf that once loaded with PAC (https://pdfua.foundation/en/pdf-accessibility-checker-pac/) will give you an error ^^ Also if you try to oper the logical structure and you click on the figure tag you will obtain the error again ^^

    Let me know if you need something else :slight_smile:

  • Posted 18 September 2023, 2:14 am EST

    Hi,

    Thanks for the stripped sample. We are able to replicate this behavior at or end, on the AxesCheck and PDF Accessibility Check application as well.

    This behavior seems like a bug. So, we have escalated this issue to the development team.

    Will get back to you once we have any update from them[Internal tracking Id - DOC-5704]

    Best Regards,

    Nitin

  • Posted 18 September 2023, 3:05 am EST

    Ok, thank you very much :slight_smile:

  • Posted 2 January 2024, 6:26 am EST

    Hi! Any news on the bug fix? :slight_smile:

  • Posted 3 January 2024, 5:16 am EST

    Hi,

    Apologize for the delay.

    We are discussing this with the development team. Once they provide any update, we will let you know.

    Best Regards,

    Nitin

  • Posted 3 January 2024, 5:28 am EST

    Ok, thank you very much! :smiley:

  • Posted 8 January 2024, 5:15 am EST

    Hi Simona,

    Thanks for your patience.

    As per the development team, this is caused by your code. You can make some changes in your code to get rid of PAC errors. Please refer the below code:

    // The "O" property should be encoded as PDF name object
    thAttrBBox.PdfDict.Dict.Add(new PdfName("O"), new PdfName("Layout"));
    //thAttrBBox.Properties.Add("O", "Layout");
    
    // The "BBox" property should be encoded as PDF rectangle:
    // An array of four numbers in default user space units that shall give the coordinates of the
    // left, bottom, right, and top edges, respectively, of the structure element's bounding box
    // The PdfArray has constructor accepting RectangleF as parameter
    // it encodes the rectangle in correct way
    //thAttrBBox.PdfDict.Dict.Add(new PdfName("BBox"), new PdfArray(new float[] { ip.X, ip.Y, l, h }));
    thAttrBBox.PdfDict.Dict.Add(new PdfName("BBox"), new PdfArray(new RectangleF(ip.X, ip.Y, l, h)));
    //thAttrBBox.Properties.Add("BBox", new float[] { ip.X, ip.Y, l, h });

    Please refer the attached modified sample for the same: TestGrapecity_Mod.zip

    Best Regards,

    Nitin

  • Posted 8 January 2024, 12:29 pm EST

    Wonderful!! Thank you really really much! :smiley:

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels