summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-07-11 13:25:02 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-11 13:25:02 +0000
commitb66077d3ef7ba594f2a831840783549f4dd70d86 (patch)
tree2a2a79c65d5e389f4878ed3f131414f85ea4a6a9 /testing
parentad1f7b410cd6885bd22d9ee49d9f80d3017f131f (diff)
downloadpdfium-b66077d3ef7ba594f2a831840783549f4dd70d86.tar.xz
Add FPDFFormObj_CountObjects() API
To find out the number of sub-objects a form object has, similar to how FPDFPage_CountObjects() does it for page objects. Change-Id: I7e5775dece42b74fd5b71b1d9622a1aa37bf64ac Reviewed-on: https://pdfium-review.googlesource.com/37316 Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'testing')
-rw-r--r--testing/resources/form_object.in80
-rw-r--r--testing/resources/form_object.pdf91
2 files changed, 171 insertions, 0 deletions
diff --git a/testing/resources/form_object.in b/testing/resources/form_object.in
new file mode 100644
index 0000000000..9d196bab05
--- /dev/null
+++ b/testing/resources/form_object.in
@@ -0,0 +1,80 @@
+{{header}}
+{{object 1 0}} <<
+/FormType 1
+/Subtype /Form
+/Resources
+<<
+/Font
+<<
+/F1 2 0 R
+>>
+>>
+/Type /XObject
+/BBox [0 0 612 446]
+/Length 0
+>>
+stream
+ BT
+ /F1 24 Tf
+ 1 0 0 1 260 254 Tm
+ (Hello)Tj
+ ET
+ BT
+ /F1 24 Tf
+ 1 0 0 1 260 204 Tm
+ (World)Tj
+ ET
+
+endstream
+endobj
+{{object 3 0}} <<
+/ProcSet [/PDF]
+/XObject
+<<
+/Im1 1 0 R
+>>
+>>
+endobj
+{{object 4 0}} <<
+/Resources 3 0 R
+/Parent 5 0 R
+/Contents 6 0 R
+/Type /Page
+/MediaBox [0 0 62 69]
+>>
+endobj
+{{object 6 0}} <<
+/Length 0
+>>
+stream
+q
+1 0 0 1 -260 -203 cm
+/Im1 Do
+Q
+endstream
+endobj
+{{object 5 0}} <<
+/Kids [4 0 R]
+/Type /Pages
+/Count 1
+>>
+endobj
+{{object 2 0}} <<
+/Subtype /Type1
+/Name /F1
+/Type /Font
+/BaseFont /Helvetica
+>>
+endobj
+{{object 7 0}} <<
+/Type /Catalog
+/Pages 5 0 R
+>>
+endobj
+{{xref}}
+trailer <<
+/Root 7 0 R
+/Size 8
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/form_object.pdf b/testing/resources/form_object.pdf
new file mode 100644
index 0000000000..543f0bd349
--- /dev/null
+++ b/testing/resources/form_object.pdf
@@ -0,0 +1,91 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+/FormType 1
+/Subtype /Form
+/Resources
+<<
+/Font
+<<
+/F1 2 0 R
+>>
+>>
+/Type /XObject
+/BBox [0 0 612 446]
+/Length 0
+>>
+stream
+ BT
+ /F1 24 Tf
+ 1 0 0 1 260 254 Tm
+ (Hello)Tj
+ ET
+ BT
+ /F1 24 Tf
+ 1 0 0 1 260 204 Tm
+ (World)Tj
+ ET
+
+endstream
+endobj
+3 0 obj <<
+/ProcSet [/PDF]
+/XObject
+<<
+/Im1 1 0 R
+>>
+>>
+endobj
+4 0 obj <<
+/Resources 3 0 R
+/Parent 5 0 R
+/Contents 6 0 R
+/Type /Page
+/MediaBox [0 0 62 69]
+>>
+endobj
+6 0 obj <<
+/Length 0
+>>
+stream
+q
+1 0 0 1 -260 -203 cm
+/Im1 Do
+Q
+endstream
+endobj
+5 0 obj <<
+/Kids [4 0 R]
+/Type /Pages
+/Count 1
+>>
+endobj
+2 0 obj <<
+/Subtype /Type1
+/Name /F1
+/Type /Font
+/BaseFont /Helvetica
+>>
+endobj
+7 0 obj <<
+/Type /Catalog
+/Pages 5 0 R
+>>
+endobj
+xref
+0 8
+0000000000 65535 f
+0000000015 00000 n
+0000000578 00000 n
+0000000275 00000 n
+0000000338 00000 n
+0000000521 00000 n
+0000000440 00000 n
+0000000658 00000 n
+trailer <<
+/Root 7 0 R
+/Size 8
+>>
+startxref
+707
+%%EOF