From 31c1da203bd00ff9e9ba602257bab2b4282ca945 Mon Sep 17 00:00:00 2001 From: Kurt Jung Date: Mon, 12 Oct 2015 10:34:43 -0400 Subject: Add reference PDFs for comparison purposes. Document comparison of example documents. --- doc.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc.go') diff --git a/doc.go b/doc.go index 3dd09ef..1561090 100644 --- a/doc.go +++ b/doc.go @@ -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, -- cgit v1.2.1-24-ge1ad From 2efaba8cfa054408af1330401b8b7741975f77ae Mon Sep 17 00:00:00 2001 From: Kurt Jung Date: Tue, 20 Oct 2015 12:10:08 -0400 Subject: Correct typo --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc.go') diff --git a/doc.go b/doc.go index 1561090..b05ed8e 100644 --- a/doc.go +++ b/doc.go @@ -124,7 +124,7 @@ 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 +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 -- cgit v1.2.1-24-ge1ad From f45e5e9196bb313883f36e0ccc72f052f46aa37e Mon Sep 17 00:00:00 2001 From: Kurt Jung Date: Tue, 20 Oct 2015 12:24:07 -0400 Subject: Remove listing of reference PDFs in README --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc.go') diff --git a/doc.go b/doc.go index b05ed8e..15bf40e 100644 --- a/doc.go +++ b/doc.go @@ -118,7 +118,7 @@ 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 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 -- cgit v1.2.1-24-ge1ad