Automated PDF Tests with Java

PDFUnit-Java

Carsten Siedentop

Version 2016.05

PDFUnit is the name for a group of applications and libraries to supply automated testing of PDF documents. All parts of PDFUnit are commercial and subject to licensing fees.


Table of Contents
Preface
1. About this Documentation
2. Quickstart
3. Test Scopes
3.1. Overview
3.2. Actions
3.3. Attachments
3.4. Bar Code
3.5. Bookmarks and Named Destinations
3.6. Certified PDF
3.7. Dates
3.8. DIN 5008
3.9. Document Properties
3.10. Excel Files for Validation Constraints
3.11. Fast Web View
3.12. Fonts
3.13. Form Fields
3.14. Form Fields - Text Overflow
3.15. Format
3.16. Images in PDF Documents
3.17. JavaScript
3.18. Language
3.19. Layers
3.20. Layout - Entire PDF Pages
3.21. Layout - in Page Regions
3.22. Number of PDF Elements
3.23. Page Numbers as Objectives
3.24. Passwords
3.25. PDF/A
3.26. Permissions
3.27. QR Code
3.28. Signed PDF
3.29. Tagged Documents
3.30. Text
3.31. Text - in Images (OCR)
3.32. Text - in Page Regions
3.33. Text - Ordered Text
3.34. Text - Right to Left (RTL)
3.35. Text - Rotated and Overhead
3.36. Version Info
3.37. XFA Data
3.38. XMP Data
3.39. ZUGFeRD
4. Comparing a Test PDF with a Reference
4.1. Overview
4.2. Comparing Attachments
4.3. Comparing Bookmarks
4.4. Comparing Date Values
4.5. Comparing Document Properties
4.6. Comparing Format
4.7. Comparing Form Fields
4.8. Comparing Images
4.9. Comparing JavaScript
4.10. Comparing Layout as Rendered Pages
4.11. Comparing Named Destinations
4.12. Comparing Permission
4.13. Comparing Quantities of PDF Elements
4.14. Comparing Text
4.15. Comparing XFA Data
4.16. Comparing XMP Data
4.17. More Comparisons
5. Folders and Multiple Documents
5.1. Overview
5.2. Test Multiple PDF Documents
5.3. Validate all documents in a folder
6. Experience from Practice
6.1. Text in Page Header after Page 2
6.2. Does Content Fit in Predefined Form Fields?
6.3. Name of the Former CEO
6.4. Authorized Signature of the new CEO
6.5. New Logo on each Page
6.6. Do PDF Documents comply with Company Rules?
6.7. Compare ZUGFeRD Data with Visual Content
6.8. PDF Documents on Web Sites
6.9. HTML2PDF - Does the Rendering Tool Work Correct?
6.10. Validate PDF as Mail Attachment
6.11. Validate PDF from Database
6.12. Caching Test Documents
7. PDFUnit for Non-Java Systems
7.1. A quick Look at PDFUnit-NET
7.2. A quick Look at PDFUnit-Perl
7.3. A quick Look at PDFUnit-XML
8. PDFUnit-Monitor
9. Utility Programs
9.1. General Remarks for all Utilities
9.2. Convert Unicode Text into Hex Code
9.3. Extract Field Information to XML
9.4. Extract Attachments
9.5. Extract Bookmarks to XML
9.6. Extract Font Information to XML
9.7. Extract Images from PDF
9.8. Extract JavaScript to a Text File
9.9. Extract Named Destinations to XML
9.10. Extract Signature Information to XML
9.11. Extract XFA Data to XML
9.12. Extract XMP Data to XML
9.13. Render Page Sections to PNG
9.14. Render Pages to PNG
9.15. Extract ZUGFeRD Data
10. Validation Constraints in Excel Files
11. Unicode
12. Installation, Configuration, Update
12.1. Technical Requirements
12.2. Installation
12.3. Setting Classpath in Eclipse, ANT, Maven
12.4. Set Paths Using System Properties
12.5. Using the pdfunit.config File
12.6. Verifying the Configuration
12.7. Installation of a New Release
12.8. Uninstall
13. Appendix
13.1. Instantiation of PDF Documents
13.2. Page Selection
13.3. Defining Page Areas
13.4. Comparing Text
13.5. Whitespace Processing
13.6. Single and Double Quotation Marks inside Strings
13.7. Date Resolution
13.8. Format Units - Points and Millimeters
13.9. Error Messages, Error Numbers
13.10. Set Language for Error Messages
13.11. Using XPath
13.12. JAXP-Configuration
13.13. Running PDFUnit with TestNG
13.14. Version History
13.15. Unimplemented Features, Known Bugs
Index