Solved

automated save of pdf document from iwebbrowser2

Posted on 2004-04-08
5
1,829 Views
Last Modified: 2007-12-19
I'm trying to script a save of a pdf doc inside IE.  It seems difficult.  Iwebbrowser2 does not have any apparent access to the acrobat control inside of it that I can get to.  I have experimented with trying to directly send windows messages to the adobe plugin, to no avail (probably can make it work, but its going to take some digging).

ExecWB looked promising, but if you are viewing a pdf file the save/save as is grayed, consequently failes using iwebbrowser2.  Print will work, but I need to print to a file, and that has proven surprisingly hard (most print to file stuff, does conversion, so it slightly blurs the pdf images).

Any ideas?
0
Comment
Question by:fcovely
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Kavar
ID: 10793602
document.execwb(OLECMDID cmdid,  OLECMDEXECOPT cmdopt, var1, var2)
where cmdid=4 and cmdopt=1
this will prompt the user for the filename to save as...

I included the other viable options, var1 and var2 are required based on what options you select but for what I just specified, both should be null
typedef enum  
{
     OLECMDID_OPEN              = 1,
     OLECMDID_NEW               = 2,
     OLECMDID_SAVE              = 3,
     OLECMDID_SAVEAS            = 4,
     OLECMDID_SAVECOPYAS        = 5,
     OLECMDID_PRINT             = 6,
     OLECMDID_PRINTPREVIEW      = 7,
     OLECMDID_PAGESETUP         = 8,
     OLECMDID_SPELL             = 9,
     OLECMDID_PROPERTIES        = 10,
     OLECMDID_CUT               = 11,
     OLECMDID_COPY              = 12,
     OLECMDID_PASTE             = 13,
     OLECMDID_PASTESPECIAL      = 14,
     OLECMDID_UNDO              = 15,
     OLECMDID_REDO              = 16,
     OLECMDID_SELECTALL         = 17,
     OLECMDID_CLEARSELECTION    = 18,
     OLECMDID_ZOOM              = 19,
     OLECMDID_GETZOOMRANGE      = 20
     OLECMDID_UPDATECOMMANDS    = 21
     OLECMDID_REFRESH           = 22
     OLECMDID_STOP              = 23
     OLECMDID_HIDETOOLBARS      = 24
     OLECMDID_SETPROGRESSMAX    = 25
     OLECMDID_SETPROGRESSPOS    = 26
     OLECMDID_SETPROGRESSTEXT   = 27
     OLECMDID_SETTITLE          = 28
     OLECMDID_SETDOWNLOADSTATE  = 29
     OLECMDID_STOPDOWNLOAD      = 30
} OLECMDID;
 
typedef enum  
{
    OLECMDEXECOPT_DODEFAULT        = 0,
    OLECMDEXECOPT_PROMPTUSER       = 1,
    LECMDEXECOPT_DONTPROMPTUSER    = 2,
    OLECMDEXECOPT_SHOWHELP         = 3
} OLECMDEXECOPT
0
 
LVL 10

Expert Comment

by:Kavar
ID: 10793617
if ExecWB fails, your only option is to open the url IN adobe.  (the IE presented Adobe does not have an object model - that I have found anyway)
0
 

Author Comment

by:fcovely
ID: 10800974
Ok, its worse than what I thought.  With Acrobat 6, if you physically do a file|save in IE, it does a Save Copy in A6.  However, if you send a execWB at it for save copy or save as, its ignored.  If you send a save to execwb, it trys to save it as a web page.  So I conclude adobes implementation of whatever is on the other side of execwb fails, or IE6 is hosed up in that regard.  I solved the problem by actualy sending wm_chars to IE to get to the  physical rendition of f10, 'F', 'S'  {File Save}.

0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
ID: 10836104
Closed, 500 points refunded.
Lunchy
Friendly Neighbourhood Community Support Moderator
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is about my first experience with programming Arduino.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now