Possible bug/problem with the tag attributes

Posted by: simona.fratus on 13 September 2023, 9:40 pm EST

    • Post Options:
    • Link

    Posted 13 September 2023, 9:40 pm 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 14 September 2023, 7:51 pm 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 14 September 2023, 11:45 pm EST - Updated 14 September 2023, 11:50 pm 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 17 September 2023, 5:14 pm 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 17 September 2023, 6:05 pm EST

    Ok, thank you very much :slight_smile:

  • Posted 1 January 2024, 9:26 pm EST

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

  • Posted 2 January 2024, 8:16 pm 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 2 January 2024, 8:28 pm EST

    Ok, thank you very much! :smiley:

  • Posted 7 January 2024, 8:15 pm 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, 3:29 am 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