Solved

automated save of pdf document from iwebbrowser2

Posted on 2004-04-08
5
1,844 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

832 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