diff options
author | Kurt Jung <kurt.w.jung@gmail.com> | 2015-10-12 10:34:43 -0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@gmail.com> | 2015-10-12 10:34:43 -0400 |
commit | 31c1da203bd00ff9e9ba602257bab2b4282ca945 (patch) | |
tree | 29e26e31cd7a0a8c2dbe198a77d89102faff8be1 /doc.go | |
parent | d51e132c6432f2c1bbff5d9516f77375bb5252e6 (diff) |
Add reference PDFs for comparison purposes. Document comparison of example documents.
Diffstat (limited to 'doc.go')
-rw-r--r-- | doc.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -120,6 +120,19 @@ Please note that these examples run in the context of a test. In order run an example as a standalone application, you'll need to examine fpdf_test.go for some helper routines, for example exampleFilename and summary. +Example PDFs can be compared with reference copies in order to verify that they +have been generated as expected. This comparison will be performed if a PDF +with the same name as the example PDF is placed in the gofpdf/pdf/reference +directory. The routine that summarizes an example will look for this file and, +if found, will call the ComparePDFFiles() to check the example PDF for equality +with its reference PDF. If differences exist between the two files they will be +printed to standard output and the test will fail. If the reference file is +missing, the comparison is considered to succeed. In order to successfully +compare two PDFs, the placement of internal resources must be consistent and +the internal creation timestamps must be the same. To do this, the methods +SetCatalogSort() and SetCreationDate() need to be called for both files. This +is done automatically for all examples. + Nonstandard Fonts Nothing special is required to use the standard PDF fonts (courier, helvetica, |