diff options
author | Kurt Jung <kurt.w.jung@gmail.com> | 2015-10-20 12:26:10 -0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@gmail.com> | 2015-10-20 12:26:10 -0400 |
commit | e2d935b7215daa9476f1ca385a15227f5f5a7011 (patch) | |
tree | 56b837702a1d3b036e081506513d79913389875f /README.md | |
parent | 26baf7d305543d6afe39d38f0b2c30054c9fa4e3 (diff) | |
parent | f45e5e9196bb313883f36e0ccc72f052f46aa37e (diff) |
Merge pull request #49 from jung-kurt/compare-reference-pdf
Compare example PDFs with reference copies
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -99,7 +99,20 @@ complete. 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](https://github.com/jung-kurt/gofpdf/blob/master/fpdf_test.go) for -some helper routines, for example exampleFilename and summary. +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 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 |