diff --git a/RelaxNG/document-pdf-ua1.rnc b/RelaxNG/document-pdf-ua1.rnc index 4933dfd..66c38d4 100644 --- a/RelaxNG/document-pdf-ua1.rnc +++ b/RelaxNG/document-pdf-ua1.rnc @@ -11,6 +11,12 @@ namespace Table = "http://iso.org/pdf/ssn/Table" namespace List = "http://iso.org/pdf/ssn/List" namespace Artifact = "http://iso.org/pdf/ssn/Artifact" +# XMP +namespace x = "adobe:ns:meta/" +namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" +namespace dc = "http://purl.org/dc/elements/1.1/" +namespace pdfuaid = "http://www.aiim.org/pdfua/ns/id/" + # XHTML Namespace, not currently used namespace h = "http://www.w3.org/1999/xhtml" @@ -40,7 +46,8 @@ pdf1rolemap-Note = attribute rolemaps-to {"Note"} # UA-1 does not force a single document element. start = PDF -PDF = element NoNS:PDF {StructTreeRoot} +PDF = element NoNS:PDF {StructTreeRoot,XMP?} + StructTreeRoot = element NoNS:StructTreeRoot {( Document|DocumentFragment|Part|Art|Div|Sect|TOC|Aside|BlockQuote|NonStruct|Private|P|Note|Code|Hn|H|Title|Link|Annot|Form|FENote|Index|L|Table|Figure|Formula|Artifact)*} AssociatedFile = element NoNS:AssociatedFile { @@ -62,8 +69,24 @@ formula-requirements = ( attribute alt {text} ) +## PDF/UA-1 +pdfuaid_part = element pdfuaid:part {"1"} + ## share with pdf1.7 version from here to end +# XMP data +anyelem = element * {(attribute * {text}* | text | anyelem) *} + +XMP = element NoNS:XMP {x_xmpmeta & anyelem*} + +x_xmpmeta = element x:xmpmeta {attribute * {text}*,(rdf_RDF & anyelem*)} + +rdf_RDF= element rdf:RDF {attribute * {text}*, (rdf_Description & anyelem*)} + +rdf_Description= element rdf:Description {attribute * {text}*, (pdfuaid_part & anyelem*)} + +# end of XMP + textorHTML &= (Link|Reference|Strong|Code|Em|Lbl|Span|mathse|Quote|RB|Annot|Figure|Form)* MathMLPGlobalAttributes &= showtags-attributes @@ -602,3 +625,4 @@ pdf2-attributes, (text|NonStruct|Private|Note|Code|Sub|Lbl|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|BibEntry|Figure|Formula|Artifact)* } + diff --git a/RelaxNG/document-pdf-ua1.rng b/RelaxNG/document-pdf-ua1.rng index a78275b..90bbac5 100644 --- a/RelaxNG/document-pdf-ua1.rng +++ b/RelaxNG/document-pdf-ua1.rng @@ -1,2717 +1,2869 @@ - - - - - - - - - - - - - MathML Namespace (temp actualtext moved to content element in new code) - - - - - - - \s*(([\-+]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s* - - - - - - - - - - - - - P - - - - - Span - - - - - Note - - - - - - - - - PDF - - - - - - StructTreeRoot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AssociatedFile - - - - - - - - - share with pdf1.7 version from here to end - - - - - - - - - - - - - - - - - - - - - - - PDF structure Namespace - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block - Inline - Before - Start - End - - - - - - - LrTb - RlTb - TbRl - TbLr - LrBt - RlBt - BtRl - BtLr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Start - Center - End - Justify - - - - - - - - - - - - - - - - - - Underline - Overline - LineThrough - - - - - - - Sup - Sub - Normal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - None - Unordered - Description - Disc - Circle - Square - Ordered - Decimal - UpperRoman - LowerRoman - UpperAlpha - LowerAlpha - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Document Level - - Document - - - - - - - - - - - - DocumentFragment - - - - - - - - - - - - Grouping - - Part - - - - - - - - - - - - - - - - - - Sect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Aside - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NonStruct - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Div - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block - - P - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - H1 - - - - - - H2 - - - - - - H3 - - - - - - H4 - - - - - - H5 - - - - - - H6 - - - - - - H7 - - - - - - - H - - - - - - Title - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FENote - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BibEntry - - - - - - - - - - - - - - - - - - - - - - - - - - Sub Block - - Sub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Inline - - Lbl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Em - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Strong - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Span - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Link - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Annot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Form - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ruby - - Ruby - - - - - Start - Center - End - Justify - Distribute - - - - - - - Before - After - Warichu - Inline - - - - - - - - - - - - - - - - - - - - - - - - - - - - RB - - - - - Start - Center - End - Justify - Distribute - - - - - - - Before - After - Warichu - Inline - - - - - - - - - - - - - - - - - - - - - - - - - - RT - - - - - Start - Center - End - Justify - Distribute - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Warichu - - - - - - - - - - - - - - - - - - - - WT - - - - - - - - - - - - - - - - - - - - - - - WP - - - - - - - - - - - - - - - - - - - - - - - Lists - - L - - - - - - - - - - - - - - - - - - - - - LI - - - - - - - - - - - - - - - - - LBody - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tables - - Table - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - THead - - - - - - - - - - - - - - - TBody - - - - - - - - - - - - - - - TFoot - - - - - - - - - - - - - - TR - - - - - - - - - - - - - - - - TH - - - - - - - - - - - Before - Middle - After - Justify - - - - - - - Start - Center - End - - - - - - - - - - - - - - - Column - Row - Both - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TD - - - - - - - - - - - Before - Middle - After - Justify - - - - - - - Start - Center - End - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Caption - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Figure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Formula - - Formula - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Artifact - - Artifact - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PDF1 - - Art - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Private - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TOC - - - - - - - - - - - - - - - - - - - - - TOCI - - - - - - - - - - - - - - - - - - Note - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Reference - - - - - - - - - - - - - - - - - - - - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BlockQuote - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Quote - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + MathML Namespace (temp actualtext moved to content element in new code) + + + + + + + \s*(([\-+]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s* + + + + + + + + + + + + + P + + + + + Span + + + + + Note + + + + + + + + + PDF + + + + + + + + + StructTreeRoot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AssociatedFile + + + + + + + + + + AssociatedFile + + + + + + + AssociatedFile + + + + + + + + + + + + PDF/UA-1 + + 1 + + + + + share with pdf1.7 version from here to end + + + + + + + + + + + + + + + + + + XMP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PDF structure Namespace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Block + Inline + Before + Start + End + + + + + + + LrTb + RlTb + TbRl + TbLr + LrBt + RlBt + BtRl + BtLr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Start + Center + End + Justify + + + + + + + + + + + + + + + + + + Underline + Overline + LineThrough + + + + + + + Sup + Sub + Normal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + Unordered + Description + Disc + Circle + Square + Ordered + Decimal + UpperRoman + LowerRoman + UpperAlpha + LowerAlpha + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Document Level + + Document + + + + + + + + + + + + DocumentFragment + + + + + + + + + + + + Grouping + + Part + + + + + + + + + + + + + + + + + + Sect + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aside + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NonStruct + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Div + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Block + + P + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + H1 + + + + + + H2 + + + + + + H3 + + + + + + H4 + + + + + + H5 + + + + + + H6 + + + + + + H7 + + + + + + + H + + + + + + Title + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FENote + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BibEntry + + + + + + + + + + + + + + + + + + + + + + + + + + Sub Block + + Sub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inline + + Lbl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Em + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Strong + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Span + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Link + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Annot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ruby + + Ruby + + + + + Start + Center + End + Justify + Distribute + + + + + + + Before + After + Warichu + Inline + + + + + + + + + + + + + + + + + + + + + + + + + + + + RB + + + + + Start + Center + End + Justify + Distribute + + + + + + + Before + After + Warichu + Inline + + + + + + + + + + + + + + + + + + + + + + + + + + RT + + + + + Start + Center + End + Justify + Distribute + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Warichu + + + + + + + + + + + + + + + + + + + + WT + + + + + + + + + + + + + + + + + + + + + + + WP + + + + + + + + + + + + + + + + + + + + + + + Lists + + L + + + + + + + + + + + + + + + + + + + + + LI + + + + + + + + + + + + + + + + + LBody + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tables + + Table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + THead + + + + + + + + + + + + + + + TBody + + + + + + + + + + + + + + + TFoot + + + + + + + + + + + + + + TR + + + + + + + + + + + + + + + + TH + + + + + + + + + + + Before + Middle + After + Justify + + + + + + + Start + Center + End + + + + + + + + + + + + + + + Column + Row + Both + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TD + + + + + + + + + + + Before + Middle + After + Justify + + + + + + + Start + Center + End + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Caption + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Figure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formula + + Formula + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Artifact + + Artifact + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PDF1 + + Art + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Private + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TOC + + + + + + + + + + + + + + + + + + + + + TOCI + + + + + + + + + + + + + + + + + + Note + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Reference + + + + + + + + + + + + + + + + + + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BlockQuote + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Quote + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RelaxNG/document-pdf-ua2.rnc b/RelaxNG/document-pdf-ua2.rnc index 615a7ea..e8c638a 100644 --- a/RelaxNG/document-pdf-ua2.rnc +++ b/RelaxNG/document-pdf-ua2.rnc @@ -11,6 +11,12 @@ namespace Table = "http://iso.org/pdf/ssn/Table" namespace List = "http://iso.org/pdf/ssn/List" namespace Artifact = "http://iso.org/pdf/ssn/Artifact" +# XMP +namespace x = "adobe:ns:meta/" +namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" +namespace dc = "http://purl.org/dc/elements/1.1/" +namespace pdfuaid = "http://www.aiim.org/pdfua/ns/id/" + # XHTML Namespace, not currently used namespace h = "http://www.w3.org/1999/xhtml" @@ -38,7 +44,8 @@ pdf1rolemap-Note = notAllowed? # UA-2 Single Document element root. start = PDF -PDF = element NoNS:PDF {StructTreeRoot} +PDF = element NoNS:PDF {StructTreeRoot,XMP?} + StructTreeRoot = element NoNS:StructTreeRoot {Document|DocumentFragment} AssociatedFile = element NoNS:AssociatedFile { @@ -62,8 +69,24 @@ formula-requirements = ( AssociatedFilemath ) +## PDF/UA-2 +pdfuaid_part = element pdfuaid:part {"2"} + ## share with pdf1.7 version from here to end +# XMP data +anyelem = element * {(attribute * {text}* | text | anyelem) *} + +XMP = element NoNS:XMP {x_xmpmeta & anyelem*} + +x_xmpmeta = element x:xmpmeta {attribute * {text}*,(rdf_RDF & anyelem*)} + +rdf_RDF= element rdf:RDF {attribute * {text}*, (rdf_Description & anyelem*)} + +rdf_Description= element rdf:Description {attribute * {text}*, (pdfuaid_part & anyelem*)} + +# end of XMP + textorHTML &= (Link|Reference|Strong|Code|Em|Lbl|Span|mathse|Quote|RB|Annot|Figure|Form)* MathMLPGlobalAttributes &= showtags-attributes diff --git a/RelaxNG/document-pdf-ua2.rng b/RelaxNG/document-pdf-ua2.rng index 14c8f16..b9ef050 100644 --- a/RelaxNG/document-pdf-ua2.rng +++ b/RelaxNG/document-pdf-ua2.rng @@ -1,2633 +1,2792 @@ - - - - - - - - - - - - - MathML Namespace (temp actualtext moved to content element in new code) - - - - - - - \s*(([\-+]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PDF - - - - - - StructTreeRoot - - - - - - - - - AssociatedFile - - - - - - - - - share with pdf1.7 version from here to end - - - - - - - - - - - - - - - - - - - - - - - PDF structure Namespace - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block - Inline - Before - Start - End - - - - - - - LrTb - RlTb - TbRl - TbLr - LrBt - RlBt - BtRl - BtLr - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Start - Center - End - Justify - - - - - - - - - - - - - - - - - - Underline - Overline - LineThrough - - - - - - - Sup - Sub - Normal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - None - Unordered - Description - Disc - Circle - Square - Ordered - Decimal - UpperRoman - LowerRoman - UpperAlpha - LowerAlpha - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Document Level - - - - - - - - - - - - - - - - - - - - - - - - Grouping - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sub Block - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Inline - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ruby - - - - - - Start - Center - End - Justify - Distribute - - - - - - - Before - After - Warichu - Inline - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Start - Center - End - Justify - Distribute - - - - - - - Before - After - Warichu - Inline - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Start - Center - End - Justify - Distribute - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Lists - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tables - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Before - Middle - After - Justify - - - - - - - Start - Center - End - - - - - - - - - - - - - - - Column - Row - Both - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Before - Middle - After - Justify - - - - - - - Start - Center - End - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Formula - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Artifact - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PDF1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + MathML Namespace (temp actualtext moved to content element in new code) + + + + + + + \s*(([\-+]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PDF + + + + + + + + + StructTreeRoot + + + + + + + + + AssociatedFile + + + + + + + + + + AssociatedFile + + + + + + + AssociatedFile + + + + + + + + + + + + + + + + + + + PDF/UA-2 + + 2 + + + + + share with pdf1.7 version from here to end + + + + + + + + + + + + + + + + + + XMP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PDF structure Namespace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Block + Inline + Before + Start + End + + + + + + + LrTb + RlTb + TbRl + TbLr + LrBt + RlBt + BtRl + BtLr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Start + Center + End + Justify + + + + + + + + + + + + + + + + + + Underline + Overline + LineThrough + + + + + + + Sup + Sub + Normal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + Unordered + Description + Disc + Circle + Square + Ordered + Decimal + UpperRoman + LowerRoman + UpperAlpha + LowerAlpha + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Document Level + + + + + + + + + + + + + + + + + + + + + + + + Grouping + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Block + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sub Block + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inline + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ruby + + + + + + Start + Center + End + Justify + Distribute + + + + + + + Before + After + Warichu + Inline + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Start + Center + End + Justify + Distribute + + + + + + + Before + After + Warichu + Inline + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Start + Center + End + Justify + Distribute + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lists + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Before + Middle + After + Justify + + + + + + + Start + Center + End + + + + + + + + + + + + + + + Column + Row + Both + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Before + Middle + After + Justify + + + + + + + Start + Center + End + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Formula + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Artifact + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PDF1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RelaxNG/latex-custom.rnc b/RelaxNG/latex-custom.rnc index ac1c69a..6d28067 100644 --- a/RelaxNG/latex-custom.rnc +++ b/RelaxNG/latex-custom.rnc @@ -2,6 +2,7 @@ namespace latexSEplay = "https://www.latex-project.org/ns/local/plays" namespace latexSEamse = "https://www.latex-project.org/ns/local/asmeconf" namespace luatexko = "https://www.latex-project.org/ns/local/luatexko" namespace latexSEamsej = "https://www.latex-project.org/ns/local/asmejour" +namespace mitthesis = "https://www.latex-project.org/ns/local/mitthesis" include "latex-document.rnc" @@ -40,6 +41,14 @@ Div |= element latexSEamsej:Author_Block { text-unit* } +Div |= element latexSEamse:Paper_number { + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } + # luatexko @@ -60,3 +69,76 @@ Div|= element luatexko:Horizontal { attribute rolemaps-to {"Div"}, (text-unit|P)* } + +## mithesis +Div |= element mitthesis:Author{ + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } +Div |= element mitthesis:Degree{ + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } +Div |= element mitthesis:Copyright{ + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } + +Div |= element mitthesis:Title_sig_block{ + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } +Div |= element mitthesis:Nomenclature_list{ + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } +Div |= element mitthesis:Abstract_title{ + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } +Div |= element mitthesis:Abstract_text{ + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } +Div |= element mitthesis:Abstract_supervisor{ + showtags-attributes, + attribute rolemaps-to {"Div"}, + attribute id {text}?, + attribute title {text}?, + text-unit* + } +Sect |= element mitthesis:Abstract_page{ + showtags-attributes, + attribute rolemaps-to {"Sect"}, + attribute id {text}?, + attribute title {text}?, + (Div|text-unit)* + } +Span |= element mitthesis:Nomenclature_entry_heading{ + showtags-attributes, + attribute rolemaps-to {"Span"}, + attribute id {text}?, + attribute title {text}?, + (Em|Span)* + } diff --git a/RelaxNG/latex-custom.rng b/RelaxNG/latex-custom.rng index 0ed7832..f0a188d 100644 --- a/RelaxNG/latex-custom.rng +++ b/RelaxNG/latex-custom.rng @@ -1,5 +1,5 @@ - + @@ -80,6 +80,23 @@ + + + + + Div + + + + + + + + + + + + @@ -123,4 +140,181 @@ + + mithesis + + + + Div + + + + + + + + + + + + + + + + + Div + + + + + + + + + + + + + + + + + Div + + + + + + + + + + + + + + + + + Div + + + + + + + + + + + + + + + + + Div + + + + + + + + + + + + + + + + + Div + + + + + + + + + + + + + + + + + Div + + + + + + + + + + + + + + + + + Div + + + + + + + + + + + + + + + + + Sect + + + + + + + + + + + + + + + + + + + + Span + + + + + + + + + + + + + + + diff --git a/show-pdf-tags/show-pdf-tags.1 b/show-pdf-tags/show-pdf-tags.1 index 82d9ed9..959c4f5 100644 --- a/show-pdf-tags/show-pdf-tags.1 +++ b/show-pdf-tags/show-pdf-tags.1 @@ -40,9 +40,13 @@ Valid are: \fB\-\-table\fR Show Lua table structure .TP \fB\-\-map\fR Follow role mapping (xml printer) +.TP + \fB\-\-xmp\fR Include XMP XML (xml printer) .TP \fB\-\-w3c-\fR Add - to w3c namespaces to force browser display -.fi +.PP +.FI + .SH "SEE ALSO" Full manual available via 'texdoc show-pdf-tags'. @@ -51,4 +55,4 @@ Repository : https://github.com/latex3/pdf_structure Bug tracker: https://github.com/latex3/pdf_structure/issues .SH AUTHORS -Copyright (C) 2024\(en2025 The LaTeX Project +Copyright (C) 2024\(en2026 The LaTeX Project diff --git a/show-pdf-tags/show-pdf-tags.lua b/show-pdf-tags/show-pdf-tags.lua index d8a5e15..68ce731 100755 --- a/show-pdf-tags/show-pdf-tags.lua +++ b/show-pdf-tags/show-pdf-tags.lua @@ -12,6 +12,7 @@ end local out_format = "tree" local follow_rolemap = false local hide_w3c = false +local show_xmp = false local pdfe = pdfe or require'pdfe' local process_stream = require'show-pdf-tags_process_stream' @@ -317,6 +318,7 @@ local function open(filename) local catalog = pdfe.getcatalog(document) local markinfo = catalog and catalog.MarkInfo local tagged = markinfo and markinfo.Marked + local xmp = catalog and catalog.Metadata if not tagged then io.stderr:write("Document catalog has no markinfo.Marked entry. It might not be tagged.\n") @@ -332,6 +334,8 @@ local function open(filename) ctx.id_map = id_map ctx.ref_entries = {} + ctx.xmp = xmp + local structroot = catalog.StructTreeRoot if not structroot then return {}, ctx @@ -697,7 +701,11 @@ local function print_tree_xml(tree, ctx) end print ("\n ") recurse(tree, ' ', '', '', ' ') - print (" \n") + print (" \n") + if show_xmp then + print(" \n" ..pdfe.readwholestream(ctx.xmp,true):gsub("\n[ \n]*\n","\n") .. "\n \n") + end + print ("") return end @@ -712,6 +720,7 @@ Options --xml show as XML --table show Lua table structure --map Follow role mapping (xml printer) + --xmp include XMP XML (xml printer) --w3c- Add - to w3c namespaces to force browser tree display ]] @@ -728,6 +737,8 @@ while argi <= #arg and arg[argi]:match("^%-") do follow_rolemap=true elseif arg[argi] == "--w3c-" then hide_w3c=true + elseif arg[argi] == "--xmp" then + show_xmp=true elseif arg[argi] == "--help" or arg[argi] == "-h" then io.stderr:write(string.format(helpstr, arg[0])) return