How to get data and images from a PDF?
-
- Posts: 30
- Joined: Mon Jan 21, 2013 1:31 pm
How to get data and images from a PDF?
Hai All,
How to get data and images from a PDF? Is there any Plugin available for it? If yes, then how to add it in ranorex and use it? Please Help me in this issue.
Regards,
Amir aka AutomationTester
How to get data and images from a PDF? Is there any Plugin available for it? If yes, then how to add it in ranorex and use it? Please Help me in this issue.
Regards,
Amir aka AutomationTester
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to get data and images from a PDF?
Hi,
You should be able to automate a PDF without having to make any changes in Ranorex, there is no specific Ranorex plugin for PDF.
Could you please describe in detail which problems you are facing and which Ranorex version you are using?
Thanks,
Markus
You should be able to automate a PDF without having to make any changes in Ranorex, there is no specific Ranorex plugin for PDF.
Could you please describe in detail which problems you are facing and which Ranorex version you are using?
Thanks,
Markus
-
- Posts: 30
- Joined: Mon Jan 21, 2013 1:31 pm
Re: How to get data and images from a PDF?
Hai Markus,
Good day. Actually, After my application finished it's execution,it generates a PDF document containing all details about it. It contains both images and text. As my friend suggested I downloaded "iTextSharp" dll. But, I don't know how to add the dll in ranorex and use it.
I'm attaching the zip file of dll and a PDF file (inside zip). Please help me with an example.
Thanks and Regards,
Amir aka AutomationTester
Good day. Actually, After my application finished it's execution,it generates a PDF document containing all details about it. It contains both images and text. As my friend suggested I downloaded "iTextSharp" dll. But, I don't know how to add the dll in ranorex and use it.
I'm attaching the zip file of dll and a PDF file (inside zip). Please help me with an example.
Thanks and Regards,
Amir aka AutomationTester
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to get data and images from a PDF?
Hello,
Thank you for your files.
You do not need any plugin or DLL to identify elements in your PDF.
Please use the current Adobe Reader XI and set recommended accessibility options.
These options can be set if you select the menu 'Edit/Accessibility/Setup Assistant'.
Please click on 'Use recommended settings' in the assistant.
Please verify if you have 'Read the entire document' is selected in 'Edit/Accessibility/Change Reading Options'.
Regards,
Markus (T)
Thank you for your files.
You do not need any plugin or DLL to identify elements in your PDF.
Please use the current Adobe Reader XI and set recommended accessibility options.
These options can be set if you select the menu 'Edit/Accessibility/Setup Assistant'.
Please click on 'Use recommended settings' in the assistant.
Please verify if you have 'Read the entire document' is selected in 'Edit/Accessibility/Change Reading Options'.
Regards,
Markus (T)
Re: How to get data and images from a PDF?
AS well I need to compare values in pdf but In my case Edit/Accessibility/Change Reading Options is grayed out. What we should do?
Thanks
Thanks
Re: How to get data and images from a PDF?
Hi,
Check the properties of your PDF file... I guess the Accessibility option is "Not Allowed" in your case? The only thing you can probably do is to ask the PDF owner/creator to unlock this option? Then you should be able to access the content of PDF files from Ranorex.
Check the properties of your PDF file... I guess the Accessibility option is "Not Allowed" in your case? The only thing you can probably do is to ask the PDF owner/creator to unlock this option? Then you should be able to access the content of PDF files from Ranorex.
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to get data and images from a PDF?
Content Coping for Accessibility in case is Allowed but when I want to validate data I'm getting this.
Please see an attachment.
Please see an attachment.
Re: How to get data and images from a PDF?
That's OK. You just need to confirm this dialog and wait to finish the PDF processing. After that, you should be able to read and evaluate the PDF content.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to get data and images from a PDF?
Unfortunately Ranorex doesn't recognized the value it self. Is it possible to get value from this validation?
At the moment I'm using Ranorex Spy. On the left right top of corner in Ranorex spy it is says Ranorex Spy(32bit) - Live is it correct? I'm using Windows 7 64 bit system may be that's why Spy cannot recognized the value?
Please see an attachment.
At the moment I'm using Ranorex Spy. On the left right top of corner in Ranorex spy it is says Ranorex Spy(32bit) - Live is it correct? I'm using Windows 7 64 bit system may be that's why Spy cannot recognized the value?
Please see an attachment.
Re: How to get data and images from a PDF?
I guess you started the spy from Ranorex Studio? Because Ranorex Studio itself is 32bit application, it starts 32bit spy. You can always start 64bit spy outside the Studio. Just go to Start > Programs > Ranorex menu and here select 64bit spy (the one without bit extension). But I personally don't think this will help. What exactly do you see in spy if you select that highlighted section? Is there a "text" or "value" attribute containing the content of selection?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to get data and images from a PDF?
Yes, if I select Text on left side of panel it will display Policy Number on right side but with additional data. I need only policy number to compare. See an attachment for details.
You do not have the required permissions to view the files attached to this post.
Re: How to get data and images from a PDF?
I think you will have to parse the text you obtain from the PDF. Maybe a clever regular expression could be useful here? Could you please post a snapshot file generated from the selected PDF element? See these instructions how to create one...
http://www.ranorex.com/support/user-gui ... files.html
http://www.ranorex.com/support/user-gui ... files.html
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to get data and images from a PDF?
Thanks a lot for helping. here it is.
Re: How to get data and images from a PDF?
OK, got it. The question now is, what exactly you want to do with that text? Just compare the number with a number stored in excel/csv file?
In the attached file, you can find an example project where you can learn how to validate the policy number in your selected PDF text, using AttributeContains action. Next line in recording show you how to get the policy number using GetValue action and a regular expression searching for any number found after "#:" string. Last line simply wrote the obtained number to report. My knowledge of RegEx is far from ideal so there could be a better/simpler way to do it?
For example, if you know the Policy number is always 6 digits, instead of using (?<=#:\s)\d* pattern, it should be just enough to use \d{6} ?
If you prefer to use the coded way (instead of record-based actions), simply examine the code behind each action (right click on action and select View Code). Hope this helps?
In the attached file, you can find an example project where you can learn how to validate the policy number in your selected PDF text, using AttributeContains action. Next line in recording show you how to get the policy number using GetValue action and a regular expression searching for any number found after "#:" string. Last line simply wrote the obtained number to report. My knowledge of RegEx is far from ideal so there could be a better/simpler way to do it?

If you prefer to use the coded way (instead of record-based actions), simply examine the code behind each action (right click on action and select View Code). Hope this helps?
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to get data and images from a PDF?
Thank you, Pavel. I will try to do it. I have just started to learn this tool.