Jump to content



Photo

[Solved] IE + PDF - saving PDF without opening file save dialog


  • Please log in to reply
9 replies to this topic

#1 mlipok

mlipok

    Prodigy

  • Active Members
  • PipPipPip
  • 187 posts

Posted 19 April 2012 - 08:36 PM

I manualy open this pdf in InternetExplorer

http://michaelo.pl/test_pdf/test.pdf

how to connect to this opened PDF using acrobat reader COM object

and how to save that PDF without opening file save dialog

Edited by mlipok, 01 May 2012 - 07:13 PM.






#2 mlipok

mlipok

    Prodigy

  • Active Members
  • PipPipPip
  • 187 posts

Posted 22 April 2012 - 01:19 PM

I need something like

_IEAttach
__IEControlGetObjFromHWND

but I don't need attach to IE object


I need attach to AcroPDF.PDF.1 object --> opened pdf document

normaly opened in Acrobat Reader
and
opened in IE

#3 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,888 posts

Posted 23 April 2012 - 12:55 PM

You may be able to get a reference to it with ObjGet

Dale
IE.au3 issues with Vista - Workarounds, Automate input type=file (Related)SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=YFree Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model,Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbeddedFind and harvest Enum constants for COM codeAutoIt Snippets Database - you too can contribute!Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your troubleDoesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

#4 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 9,692 posts

Posted 23 April 2012 - 01:55 PM

Why not just get the address from IE and download the file yourself?

#5 mlipok

mlipok

    Prodigy

  • Active Members
  • PipPipPip
  • 187 posts

Posted 23 April 2012 - 04:13 PM

DaleHohm

THX
I check it



Richard Robertson

this is not that simple
adress
http://michaelo.pl/test_pdf/test.pdf
is only for example

I have problem with pdf which are opened in IE but url is diffrent than pdf file name

#6 mlipok

mlipok

    Prodigy

  • Active Members
  • PipPipPip
  • 187 posts

Posted 23 April 2012 - 04:44 PM

small example

#include <ie.au3> Local $oInternet = _IECreate() $oInternet.Navigate("<a href='http://michaelo.pl/test_pdf/test.pdf' class='bbc_url' title='External link' rel='nofollow external'>http://michaelo.pl/test_pdf/test.pdf"</a>) ; Opening a web page that contains a form MsgBox(0,'','') ;_IELoadWait($oInternet) ;Sleep(4000) ; Give the page time to load Local $oDoc = $oInternet.document ; Example object to test ;Local $oForm = $oDoc.forms(0) ; Example object to test MsgBox(0, "", "Interface name of $oInternet is: " & ObjName($oInternet) & @CRLF & _   "Object name of $oInternet is:    " & ObjName($oInternet, 2) & @CRLF & _   "Interface name of $oDoc is:    " & ObjName($oDoc) & @CRLF & _   "Object name of $oDoc is:      " & ObjName($oDoc, 2) & @CRLF  )


#7 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,888 posts

Posted 23 April 2012 - 05:51 PM

Are you trying to manipulate a PDF form? I've been down that road -- unfortunately what I found is that the COM interface from Adobe applies only to forms opened in Acrobat running in a local instance. The control hosted in a browser is different and they do not supply a COM interface to it (I opened a support case with Adobe about this and they first told me all I needed was Acrobat Pro, but later admitted that it could not be done).

Dale
IE.au3 issues with Vista - Workarounds, Automate input type=file (Related)SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=YFree Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model,Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbeddedFind and harvest Enum constants for COM codeAutoIt Snippets Database - you too can contribute!Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your troubleDoesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

#8 mlipok

mlipok

    Prodigy

  • Active Members
  • PipPipPip
  • 187 posts

Posted 29 April 2012 - 02:20 PM

THX
DaleHohm

you have right

but i still think how to easy save opened PDF and I have an idea

before I open IE

I want to flush
@UserProfileDir & "Local settingTemporary Internet FilesContent.IE5"

its easy

PDF which I taken from the Web is always named "'aram.nkw*.pdf'"

what I must to do is : analyse directory structure for finding file "'aram.nkw*.pdf'"


but maybe there is a easy way ?

QUESTION:
how I can take a file name (or file location) from PDF document opened in IE

Edited by mlipok, 29 April 2012 - 06:43 PM.


#9 mlipok

mlipok

    Prodigy

  • Active Members
  • PipPipPip
  • 187 posts

Posted 01 May 2012 - 07:12 PM

;)
I just found a solution

It's easy
very easy and i think "How I can't get the solution before"

When I use AutoIT v3 Window Info
then in "Visible Text" now I see there is full path to the localy stored file


Pasek poleceń
Pasek poleceń Ulubione
LinksBand
Pasek ulubionych
Dodaj do paska ulubionych
ITBarHost
Pasek menu
100%
100%
Wyszukiwarka Google
Wyszukiwarka Google
Zaznaczenie na stronie
Zaznaczenie na stronie
http://michaelo.pl/test_pdf/test.pdf - Windows Internet Explorer
Gotowe
C:\Documents and Settings\u1\Ustawienia lokalne\Temporary Internet Files\Content.IE5\R4RX6L06\test[1].pdf - Adobe Reader
AVToolBarHostView
AVTableContainerView
AVTabStripView
AVSplitterView
AVSplitationPageView
AVSplitterView
AVScrolledPageView
AVScrollView
AVTableContainerView
8,27 x 11,70 cale
AVPageView
AVToolBarEasel
AVToolBarEasel
AVToolBarEasel
AVToolBarEasel
AVToolBarEasel
113%
1



#10 mlipok

mlipok

    Prodigy

  • Active Members
  • PipPipPip
  • 187 posts

Posted 01 May 2012 - 07:34 PM

$string = WinGetText('http://michaelo.pl/test_pdf/test.pdf - Windows Internet Explorer', 'AVToolBarHostView') StringRegExp($string,'(?i).*Temporary Internet Files.*.pdf',3)

Edited by mlipok, 01 May 2012 - 07:40 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users