[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1924
  • Last Modified:

automated save of pdf document from iwebbrowser2

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
fcovely
Asked:
fcovely
  • 2
1 Solution
 
KavarCommented:
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
 
KavarCommented:
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
 
fcovelyAuthor Commented:
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
 
LunchyCommented:
Closed, 500 points refunded.
Lunchy
Friendly Neighbourhood Community Support Moderator
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now