[Poppler-bugs] [Bug 64815] [TAGGEDPDF] Parse the Tagged-PDF document structure tree when present

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Aug 28 00:55:19 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=64815

--- Comment #36 from Carlos Garcia Campos <carlosgc at gnome.org> ---
Comment on attachment 82287
  --> https://bugs.freedesktop.org/attachment.cgi?id=82287
[PATCH v6 02/10] Tagged-PDF: Implement parsing of StructTreeRoot

Review of attachment 82287:
-----------------------------------------------------------------

If we simplify this patch removing the tagged pdf bits and role/class maps that
are currently unused maybe you can merge this with the following one avoiding
the dummy class.

::: poppler/StructTreeRoot.cc
@@ +43,5 @@
> +  // The RoleMap/ClassMap dictionaries are needed by all the parsing
> +  // functions, which will resolve the custom names to canonical
> +  // standard names.
> +  root->lookup("RoleMap", &roleMap);
> +  root->lookup("ClassMap", &classMap);

Since these are actually unused in this patch, we can probably add them in the
first patch that actually uses them, since they are optional entries in the
end.

@@ +103,5 @@
> +  }
> +  obj.free();
> +
> +  // Parse the children StructElements
> +  const GBool marked = doc->getCatalog()->getMarkInfo() & Catalog::markInfoMarked;

As I commented previously I would focus first on logical structure (Section
14.7) only and then add the tagged pdf support (Section 14.8) on top of that.
That would leave this patch even simpler and maybe you can even merge this and
the following one instead of using a dummy class here just to make it build.

@@ +111,5 @@
> +      error(errSyntaxWarning, -1, "K in StructTreeRoot has more than one children in a tagged PDF");
> +    }
> +    for (int i = 0; i < kids.arrayGetLength(); i++) {
> +      Object obj, ref;
> +      kids.arrayGetNF(i, &ref);

This reference is only used in the if below.

@@ +122,5 @@
> +                          child->getType() == StructElement::Div)) {
> +            error(errSyntaxWarning, -1, "StructTreeRoot element of tagged PDF is wrong type ({0:s})", child->getTypeName());
> +          }
> +          appendElement(child);
> +          if (ref.isRef()) {

Here you could directly do:

if (kids.arrayGetNF(i, &ref)->isRef())

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20130828/60c65243/attachment.html>


More information about the Poppler-bugs mailing list