pdf-info-004

Tests that page-text works

Test is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" name="main" version="3.0">
   <p:import href="https://xmlcalabash.com/ext/library/pdf-steps.xpl"/>
   <p:output port="result"/>
   <cx:pdf-info page-text="true">
      <p:with-input href="../documents/libreoffice-form.pdf"/>
   </cx:pdf-info>
</p:declare-step>

Result

<cx:pdf-info xmlns:cx="http://xmlcalabash.com/ns/extensions"
             xmlns:t="http://xproc.org/ns/testsuite/3.0"
             href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/extra-suite/test-suite/documents/libreoffice-form.pdf">
   <cx:version>1.5</cx:version>
   <cx:form>acro-form</cx:form>
   <cx:pages>1</cx:pages>
   <cx:encrypted>false</cx:encrypted>
   <cx:page-size width="595" height="842" units="px">A4</cx:page-size>
   <cx:creator>Writer</cx:creator>
   <cx:producer>LibreOffice 6.4</cx:producer>
   <cx:creation-date>2022-06-26T08:58:43Z</cx:creation-date>
   <cx:file-size>34186</cx:file-size>
   <cx:page-details>
      <cx:page page-number="1">
         <cx:text>Example for a Form
    
Gender:
Nationality:
First Name Last Name
Birthday
Female Male
Agree to privacy policy
Other
</cx:text>
      </cx:page>
   </cx:page-details>
</cx:pdf-info>

Schematron checks

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
          xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
   <s:ns prefix="cx"
         uri="http://xmlcalabash.com/ns/extensions"/>
   <s:ns prefix="f"
         uri="http://xmlcalabash.com/ns/acro-form"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="cx:pdf-info">Wrong document element></s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/cx:pdf-info">
         <s:assert test="cx:version = 1.5">Wrong version</s:assert>
         <s:assert test="cx:form = 'acro-form'">Wrong form</s:assert>
         <s:assert test="empty(f:acro-form)">Wrong form details</s:assert>
         <s:assert test="starts-with(cx:page-details/cx:page/cx:text, 'Example for a Form')">Wrong page text</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

11 Jun 2026, Norm Tovey-Walsh
Created test.