In this blog, we are going to learn how we can
capture screenshot of any web page while executing selenium automation scripts
and store it in PDF file.
For this purpose, we would be using Java inbuilt
libraries along with iTextPDF Jar which provides the facility to capture the screenshot
and save them in PDF files.
To start with we need to add below maven
dependency or Jar. We can also download them from the Maven Repository using link.
In the code, we have following the below
sequence:
v
Capturing the screenshot and store it in byte[]
array format.
v
Initiate and open PDF writer.
v
Process and set the size of the image
v
Add Image to PDF and close the File.
Below is the detailed code snippet for
capturing screenshot of Google homepage and storing it in PDF File.
Result of the above code execution would be
Happy Learning :)
Result of the above code execution would be
Happy Learning :)
I have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site.
Replysearch text in pdf
Thanks a lot :)
ReplyI believe you have observed some very interesting points, appreciate it for the post. anyconv.com
ReplyExceptional entry! I found it very interesting. I'll check back later to see if more posts are added. apple app store mockup
ReplyI was suggested this website by my cousin. I’m not sure whether this post is written by him as no one else know such detailed about my trouble. You’re wonderful! Thanks! app store screenshots
ReplyFollow this simple system on the off chance that you need to change over flip video on macintosh to iTunes, iDVD, from this drop-up show, you can discover a progression of other pragmatic alternatives to change over flip video to iDVD, Apple TV, PSP and so forth and most regular video organizations and normal sound configurations. FLV to MP4 video converter
ReplyHey! This is kind of off topic but I need some advice from an established blog. Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about creating my own but I’m not sure where to start. Do you have any ideas or suggestions? Cheers imac template
ReplyWow, superb weblog structure! How long have you been blogging for? you make blogging glance easy. The total look of your web site is excellent, neatly as the content material! mobile app developers
ReplyI feel like I’m often looking for interesting things to read about a variety of niches, but I manage to include your blog among my reads every day because you have compelling entries that I look forward to. Here’s hoping there’s a lot more amazing material coming! web design agency
Replylisted below are a couple of urls to internet websites we connect to for the fact we feel they really are really worth browsing[...]… ui/ux designer
ReplyI really prize your work , Great post. front end website developer
ReplyCan you please share how to append text in a existing pdf file
ReplySelenium can also be used as a web-scraping tool or to create a human-replica bot to automate social-media or even test PDF files! https://www.vanguardngr.com
Reply