SAVEITEM - Corrupted PDF

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
poojakrishna
Posts: 14
Joined: Sat May 05, 2018 4:33 am
Location: India

SAVEITEM - Corrupted PDF

Post by poojakrishna » Fri Mar 15, 2019 6:20 am

iMacros Vesrion = 12.0.501.6698
OS = Windows Server 2008 R2 Enterprise
Browser = iMacros Browser
Adobe Acrobat Reader Version = 19.010.20098

Hi friends,

I'm trying to download a PDF file opened in a new tab using the SAVEITEM command but the PDF downloaded are always corrupted. If I manually download the file using the save icon on the Acrobat reader toolbar displayed on the PDF page, then it works well.

I'm stuck on this issue for the last few days. Please help.

Steps involved:
1. Clicking on a link on TAB= 1 to open a PDF
2. WAIT for the PDF to be opened on TAB=3
3. Switches to TAB=3
4. Sets the ONDOWNLOAD command
4. Calls the SAVEITEM command

Code: Select all

SET !TIMEOUT_STEP 20
TAG POS=1 TYPE=A ATTR=TXT:Print<SP>Statement 
WAIT SECONDS=5
TAB T=3
ONDOWNLOAD FOLDER=C:\Projects\Statements FILE=Statement.pdf WAIT=YES
SAVEITEM
I have tried using the SAVETARGETAS command also but it also resulted in a corrupted file.

Code: Select all

SET !TIMEOUT_STEP 20
ONDOWNLOAD FOLDER=C:\Projects\Statements FILE=Statement.pdf WAIT=YES
TAG POS=1 TYPE=A ATTR=TXT:Print<SP>Statement CONTENT=EVENT:SAVETARGETAS
Attachments
PrintStatement.png
poojakrishna
Posts: 14
Joined: Sat May 05, 2018 4:33 am
Location: India

Re: SAVEITEM - Corrupted PDF

Post by poojakrishna » Fri Mar 22, 2019 4:29 pm

I have changed the browser to Chrome with the following settings for the user profile and it downloads a not corrupted PDF.

[] Download PDF instead of opening in Chrome.
Settings -> Advanced Settings -> Content Settings -> PDF downloads -> Turn on 'Download PDF files instead of opening then in Chrome.'

Now, the PDF is being opened in a new window and is downloaded to the default download location of Chrome with a default file name. The ONDOWNLOAD statement has no effect on the download as it is being opened on another window.

Before changing the browser to Chrome I have tested on iMacros and IE after removing the Adobe add-ons and removing the PDF association with Adobe but the changes didn't help.
Tom, Tech Support
Posts: 3513
Joined: Mon May 31, 2010 4:59 pm

Re: SAVEITEM - Corrupted PDF

Post by Tom, Tech Support » Wed Apr 17, 2019 1:56 pm

Hi poojakrishna,

Since you were using the iMacros browser, that must mean that you are a licensed Professional or Enterprise customer. Why did you not open a support case for this issue using your Ipswitch customer account?
Regards,

Tom, iMacros Support
poojakrishna
Posts: 14
Joined: Sat May 05, 2018 4:33 am
Location: India

Re: SAVEITEM - Corrupted PDF

Post by poojakrishna » Thu May 09, 2019 2:05 am

Hi Tom,

I'm sorry for the delay in replying. I didn't get any notification on my mail regarding your reply. Yes, I have opened a case for this on the customer forum and it has been solved using the following command at the beginning of the macro: SET !USE_DOWNLOADMANAGER NO

Thank you.
Tom, Tech Support
Posts: 3513
Joined: Mon May 31, 2010 4:59 pm

Re: SAVEITEM - Corrupted PDF

Post by Tom, Tech Support » Thu May 09, 2019 11:38 am

Great, thanks for posting the solution here for the benefit of other users!
Regards,

Tom, iMacros Support
Post Reply