Jump to content

Recommended Posts

Posted

Hello all.  I am trying to figure out the best approach to compare PDF outputs for consistency.  Currently, this is a human task where PDFs are held up to a light to see if all the values line up exactly with test data.  I have to believe there is a better way.  That said GDIPlus is a bit of a mystery to me - I have looked at some of the functions - and I stumbled upon >this very useful script in my forum search.  My question is: would converting the PDF to an image and comparing the image with GDIPlus be the way to go or is there a different more efficient approach that you would recommend?  Any guidance would be greatly appreciated.

JFish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Posted (edited)

@this-is-me - Thanks.  That does look like an interesting package.   I will keep it in mind as the suggestions (hopefully) roll in.  I guess my threshold question is do I need to convert the PDFs to images for a comparison (seems like many tools may facilitate this) or is there another (better) way?

Edited by Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Posted (edited)

I guess you could try to use the imagesearch.au3 and keep increasing the tolerance until it is a match to your original picture?

Edit: there is a version of the imagesearch you can pass a HBMP to search in, instead of your desktop.

Edited by Geir1983
  • 3 weeks later...
Posted
  On 11/21/2014 at 2:53 PM, this-is-me said:

Not an AutoIt solution, but you might consider Perceptual Image Diff if you are going to convert to images. http://pdiff.sourceforge.net/

 

look here:

'?do=embed' frameborder='0' data-embedContent>>

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

btw.

If you want to convert PDF to image file, you can use Debenu PDF Library (look in my sign for UDF).

 

  Quote

Description

Renders certain pages from the selected document to an image file on disk.

By default rendering uses the GDI+ system which is available by default in Windows XP and later.

Option 10, TIFF (G4) output, is only available on Windows Vista and Windows Server 2008 and later.

It is also possible to render using Cairo, use the SetCairoFileName and SelectRenderer functions.

Syntax

ActiveX

Function DebenuPDFLibrary1113.PDFLibrary::RenderDocumentToFile(

DPI As Double, StartPage As Long, EndPage As Long,

Options As Long, FileName As String) As Long

Parameters

DPI The DPI to use for the rendering. A value of 72 will give the same result as Acrobat

when the zoom level is 100%.

StartPage The first page to print

EndPage The last page to print

Options

0 = BMP output

1 = JPEG output

2 = WMF output

3 = EMF output

4 = EPS output

5 = PNG output

6 = GIF output

7 = TIFF output

8 = EMF+ output

9 = HTML5 output

10 = G4 TIFF output

FileName The path and filename to use for the file.

Each page will be stored in a separate file.

If this parameter contains "%p" this will be replaced by the page number, otherwise

the page number will be appended to the end of the filename before the extension.

For example, if FileName is "output.jpg" and page 10 is rendered the image will be

stored in a file called "output10.jpg".

If FileName is "page%poutput.bmp" and page 5 is rendered the image will be stored

in a file called "page5output.bmp".

Return values

0 The pages were not rendered successfully. This is usually caused by the StartPage or

EndPage parameters being out of range.

1 The pages were rendered successfully

EDIT: REMARKS: this function need commercial version of this library.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...