Errors.
var ( ErrRenderNotSupported = errors.New("rendering PDF files is not supported on this system") )
func CompareImages(img1, img2 image.Image) (bool, error)
CompareImages compares the specified images at pixel level.
func ComparePNGFiles(file1, file2 string) (bool, error)
ComparePNGFiles compares the specified PNG files.
func CopyFile(src, dst string) error
CopyFile copies the `src` file to `dst`.
func HashFile(file string) (string, error)
HashFile generates an MD5 hash from the contents of the specified file.
func ReadPNG(file string) (image.Image, error)
ReadPNG reads and returns the specified PNG file.
func RenderPDFToPNGs(pdfPath string, dpi int, outpathTpl string) error
RenderPDFToPNGs uses ghostscript (gs) to render the specified PDF file into a set of PNG images (one per page). PNG images will be named xxx-N.png where N is the number of page, starting from 1.
func RunRenderTest(t *testing.T, pdfPath, outputDir, baselineRenderPath string, saveBaseline bool)
RunRenderTest renders the PDF file specified by `pdfPath` to the `outputDir` and compares the output PNG files to the golden files found at the `baselineRenderPath` location. If the specified PDF file is new (there are no golden files) and the `saveBaseline` parameter is set to true, the output render files are saved to the `baselineRenderPath`.