Validating prints

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
cpalex
Posts: 38
Joined: Sat Feb 17, 2018 12:37 am

Validating prints

Post by cpalex » Wed Sep 11, 2019 10:13 pm

Our AUT has a lot of options in regards to printing, and we are trying to figure out the best way to validate the layout, whether certain things are showing, the value of certain fields, and which page certain objects are on.

What methods are people using to validate things are printing properly?? I have played with printing to PDF, then opening the PDF and validating it, but the only success I have had has been with the GDI capture, which seems to be a little bit inconsistent

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6156
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validating prints

Post by odklizec » Thu Sep 12, 2019 7:29 am

Hi,

If you don't want to use GDI capture, you must ensure that the PDF is created with enabled accessibility option. But I'm not quite sure if it's doable in your AUT? So it's either GDI capture or properly generated PDF. There is most probably no other way to achieve what you want.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

cpalex
Posts: 38
Joined: Sat Feb 17, 2018 12:37 am

Re: Validating prints

Post by cpalex » Thu Sep 12, 2019 10:52 pm

Well, it's just a print operation, so we could use any Print to PDF application to generate the PDF. I have yet to find one, though, that prints a PDF I can read properly.

The generic Microsoft Print to PDF does create a PDF, and the "Content Copying for Accessibility" is set to "Allowed", but I still cannot see anything on the PDF when opening it with Adobe Acrobat Reader DC.

Is there a different option I should be looking at? Or a different application I should be opening the PDF with?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6156
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validating prints

Post by odklizec » Fri Sep 13, 2019 8:00 am

Hi,

As far as I remember, you should use Adobe Reader for PDF automation. Some other readers (like Foxit) are not working correctly with PDF accessibility. Unfortunately, I can't comment the situation regarding PDF export. Have you tried to import the PDF file from your AUT directly in Adobe Acrobat, check its accessibility options and then examine such file with Ranorex Spy?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

cpalex
Posts: 38
Joined: Sat Feb 17, 2018 12:37 am

Re: Validating prints

Post by cpalex » Fri Sep 13, 2019 11:12 pm

Like I said, we are able to print to a PDF file using the standard Windows 10 Print to PDF feature. Once the file has been printed to a PDF, I tried opening it with Adobe Acrobat Reader DC. The document properties when viewed in Acrobat Reader do show "Content Copying for Accessibility" as "Allowed", but I am unable to see the elements of the PDF in Acrobat using Spy.

User avatar
RobinHood42
Posts: 324
Joined: Fri Jan 09, 2015 3:24 pm

Re: Validating prints

Post by RobinHood42 » Tue Sep 17, 2019 2:10 pm

Hi,
if enabling the settings you mentioned in your post don't work, I don't think it will work at all with Adobe Reader. Did you already try to open the PDF in Firefox and check if the elements can be tracked there?

Cheers,
Robin

cpalex
Posts: 38
Joined: Sat Feb 17, 2018 12:37 am

Re: Validating prints

Post by cpalex » Tue Jan 21, 2020 9:30 pm

Firefox, Edge, Chrome, Adobe PDF... None of them really work.

We really need a solid solution for validating printouts, and I'm beginning to suspect it is out of the reach of Ranorex.

Does anyone have any experience with PDF comparison tools? We could easily have a reference PDF for comparing, though the date and time would change, so the tool needs to be a little more robust than a 1:1 comparison

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6156
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validating prints

Post by odklizec » Wed Jan 22, 2020 7:53 am

Hi,

I'm afraid, that without seeing the PDF in question, it's impossible to suggest anything reasonable. I personally think that the most important part of equation is correct PDF export, with supported version of Adobe Acrobat and required accessibility settings. If the individual PDF elements are not "readable" by Ranorex, then the PDF file is most probably not exported correctly or exported with unsupported version of Adobe Acrobat or 3rd party PDF exporter, which is not supported? You best hope is to contact Ranorex support (via support form) and provide them with problematic PDF, so they can analyze it and suggest what to do.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

cpalex
Posts: 38
Joined: Sat Feb 17, 2018 12:37 am

Re: Validating prints

Post by cpalex » Thu Jan 23, 2020 7:19 pm

Well, it's simple enough for me to attach a zipped up PDF with the files, so I have attached it to this post
Attachments
i1.zip
(179.67 KiB) Downloaded 11 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6156
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validating prints

Post by odklizec » Fri Jan 24, 2020 9:10 am

Hi,

I've checked the PDF you posted and it's exactly what I'd expected it to be. If you use Adobe Acrobat Reader, you should be able to extract and validate individual PDF texts. It won't be an easy task, because there is a lot of texts found by Spy and many of them are duplicated. So you must either find a good xpath, which returns only texts you are interested in, or you must validate them all. But it should not be a problem if you develop a code doing this for you? In any case, there is no reasonable way validating PDF files without code.
PDFValidation.png
PDFValidation.png (120.7 KiB) Viewed 913 times
If you are hoped for validating PDF via web browser or 3rd party PDF reader, you are most probably out of luck here. Adobe Acrobat Reader appears to be the only viable option.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

cpalex
Posts: 38
Joined: Sat Feb 17, 2018 12:37 am

Re: Validating prints

Post by cpalex » Fri Jan 24, 2020 3:39 pm

Maybe I just didn't have the GDI capture on before for Acrobat...

But now I'm getting an IPC error when I get to it.

Guess it's time to update to 9.2.1 (Still on 9.1.2) and see if that fixes it

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6156
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validating prints

Post by odklizec » Fri Jan 24, 2020 3:45 pm

Hi,

You should definitely try updating Ranorex to 9.2.1, but I'm not quite sure it will fix your new problem with IPC error (there is discussed similar problem here). In fact, there is absolutely no need to use GDI capture with Acrobat Reader! I've tried to load your PDF in AA version 2015 and I was able to track the individual elements with standard Spy tracking, i.e. without GDI capture. So no, GDI capture is not required for tracking PDF elements in AA.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration