On the acrobat 8 menu there is an option to extract pages to separate
files. Does anyone know how to access and control this from VB? I
don't see it listed in the Inter Application docs.
|
|
0
|
|
|
|
Reply
|
barcrofter
|
2/9/2008 12:29:39 AM |
|
barcrofter <jd.prsn@gmail.com> wrote:
>On the acrobat 8 menu there is an option to extract pages to separate
>files. Does anyone know how to access and control this from VB? I
>don't see it listed in the Inter Application docs.
Acrobat's automation isn't based on giving access to separate parts of
the interface.
But you can do this by repeatedly
* Create new document
* Insert page into new document
* Save new document
* Close new document
----------------------------------------
Aandi Inston
Please support usenet! Post replies and follow-ups, don't e-mail them.
|
|
0
|
|
|
|
Reply
|
quite
|
2/9/2008 7:03:14 AM
|
|
On Feb 9, 12:03 am, qu...@dial.pipex.con (Aandi Inston) wrote:
> barcrofter <jd.p...@gmail.com> wrote:
> >On the acrobat 8 menu there is an option to extract pages to separate
> >files. Does anyone know how to access and control this from VB? I
> >don't see it listed in the Inter Application docs.
>
> Acrobat's automation isn't based on giving access to separate parts of
> the interface.
>
> But you can do this by repeatedly
>
> * Create new document
> * Insert page into new document
> * Save new document
> * Close new document
>
> ----------------------------------------
> Aandi Inston
> Please support usenet! Post replies and follow-ups, don't e-mail them.
That sounds like a plan. I was looking at the IAC document print
wondering (at 4am) whether acrobat could print a page of a document to
a specific file as a pdf. many thanks.
|
|
0
|
|
|
|
Reply
|
barcrofter
|
2/9/2008 11:01:35 AM
|
|
On Feb 8, 7:29=A0pm, barcrofter <jd.p...@gmail.com> wrote:
> On the acrobat 8 menu there is an option to extract pages to separate
> files. =A0Does anyone know how to access and control this from VB? =A0I
> don't see it listed in the Inter Application docs.
Yes. You can do it using Acrobat SDK, but using C++. Not sure about
VB. Acrobat SDK is free to download.
David
~~~~~ http://www.xpsplus.com ~~~~~~~~~~~
Specifications, reviews and programming
about XML Paper Specification (XPS).
~~~~~ http://www.xpsplus.com ~~~~~~~~~~~
|
|
0
|
|
|
|
Reply
|
DavidGao
|
2/9/2008 3:51:51 PM
|
|
You may look at JSO in Acrobat IAC section, that's better then to try
menuitemExecute.
Attached a short VBS example.
HTH, Reinhard
'//Extraxt all Pages of a multipage PDF and numbers it
'//-> State the full pathname to the file you want ot work with
Path = "C:\Abmt1.pdf"
'//-> Set general used Objects
Set GApp = CreateObject("Acroexch.app")
Set AVDoc = CreateObject("AcroExch.AVDoc")
'//-> Open the File via Avdoc and assign JSO
If (AVDoc.Open(Path, Path)) Then
Set AVPageView = AVDoc.GetAVPageView
Set PDDoc = AVDoc.GetPDDoc()
Set JSO = PDDoc.GetJSObject
' gApp.Show '<==show or comment out for operate visible/invisible
'//-> Extracting all pages via JSO and save it numbered
for x = 0 to jso.numPages - 1
FLNew = "c:\test" &"_" & right(x + 1001,3) &".pdf"
jso.extractPages x, x, FLNew
next
end if
MsgBox "Done!"
Set JSO = Nothing
Set PDDoc = Nothing
Set AVDoc = Nothing
Set gApp = Nothing
|
|
0
|
|
|
|
Reply
|
ReFOB
|
2/9/2008 5:15:50 PM
|
|
On Feb 9, 8:51 am, DavidGao <david...@gmail.com> wrote:
> On Feb 8, 7:29 pm, barcrofter <jd.p...@gmail.com> wrote:
>
> > On the acrobat 8 menu there is an option to extract pages to separate
> > files. Does anyone know how to access and control this from VB? I
> > don't see it listed in the Inter Application docs.
>
> Yes. You can do it using Acrobat SDK, but using C++. Not sure about
> VB. Acrobat SDK is free to download.
>
> David
>
> ~~~~~http://www.xpsplus.com~~~~~~~~~~~
> Specifications, reviews and programming
> about XML Paper Specification (XPS).
> ~~~~~http://www.xpsplus.com~~~~~~~~~~~
Can you give me a hint as to where I should look. Ive had very little
luck browsing though that morass. I cant even find the examples.
|
|
0
|
|
|
|
Reply
|
barcrofter
|
2/9/2008 6:37:17 PM
|
|
barcrofter <jd.prsn@gmail.com> wrote:
>Can you give me a hint as to where I should look. Ive had very little
>luck browsing though that morass. I cant even find the examples.
Do you mean, where to look to download the SDK, or where to look in
the SDK for information? You will not find finished examples to copy.
----------------------------------------
Aandi Inston
Please support usenet! Post replies and follow-ups, don't e-mail them.
|
|
0
|
|
|
|
Reply
|
quite
|
2/10/2008 12:36:01 AM
|
|
barcrofter <jd.prsn@gmail.com> wrote:
>Can you give me a hint as to where I should look.
Reading back, I see you already have the SDK and the IAC document.
Check out PDDoc.InsertPages.
----------------------------------------
Aandi Inston
Please support usenet! Post replies and follow-ups, don't e-mail them.
|
|
0
|
|
|
|
Reply
|
quite
|
2/10/2008 12:37:03 AM
|
|
> > > On the acrobat 8 menu there is an option to extract pages to separate
> > > files. Does anyone know how to access and control this from VB? I
> > > don't see it listed in the Inter Application docs.
> >
> > Yes. You can do it using Acrobat SDK, but using C++. Not sure about
> > VB. Acrobat SDK is free to download.
> >
> > David
> Can you give me a hint as to where I should look. Ive had very little
> luck browsing though that morass. I cant even find the examples.
If you don't insist on using the Acrobat SDK: it is very simple to extract
pages from a PDF with command line tool PDFTK
(http://www.accesspdf.com/pdftk/); just call this with parameters from your
VB program.
Govert
|
|
0
|
|
|
|
Reply
|
Govert
|
2/10/2008 8:45:40 AM
|
|
>>> =A0I cant even find the examples.
I gave you an example, just 2 answers before.
=46rom time to time, reading helps a lot.
br, Reinhard
|
|
0
|
|
|
|
Reply
|
ReFOB
|
2/10/2008 3:29:44 PM
|
|
On Feb 10, 8:29 am, ReFOB <Re...@web.de> wrote:
> >>> I cant even find the examples.
>
> I gave you an example, just 2 answers before.
> From time to time, reading helps a lot.
>
> br, Reinhard
Actually I read them all and tried both ideas. They have been
enormously helpful!
What Im doing is comparing the speed of Lotus wordpro's ability to
generate seperate page files and pdf's via the Adobe PDF printer/
distiller combination, with acrobat's ability since wordpro is slow.
Maybe all methods are slow.
I was puzzled by the JSO idea since the acrobat.tlb has no type
information for it -- as (I now find) explained in the IAC programmers
guide. Ill check it out further since it appears to be more
powerful. I thought that maybe my Adobe 8.0 standard had no JSO.
FYI -- here's a cut at the two doc approach in vb.net (possibly with
bugs)
'---generate the single page views using acrobat
Dim AcroApp As Acrobat.AcroApp =
CType(CreateObject("AcroExch.App"), Acrobat.AcroApp)
'---for the single page files
Dim Doc1 As Acrobat.AcroPDDoc =
CType(CreateObject("AcroExch.PDDoc"), Acrobat.AcroPDDoc)
'---for the original file
Dim Doc2 As Acrobat.AcroPDDoc =
CType(CreateObject("AcroExch.PDDoc"), Acrobat.AcroPDDoc)
'---an empty pdf
Const BlankPDF = "C:\MER\PDF\Blank.pdf"
For Each selItem In ListView.SelectedItems
'---get the listview items in this section
Dim fp$ = selItem.Text
Dim fn$ = My.Computer.FileSystem.GetName(fp$)
Dim Pg%
'---use listview to ID the item in pdfOut
fp = pdfOut + "\" + Split(fn, ".")(0) + ".pdf"
Doc2.Open(fp)
'---extract each page in doc2 to doc1
For Pg = 0 To Doc2.GetNumPages - 1
'---open a blank pdf, and add 1 page from the current doc2
Doc1.Open(BlankPDF)
Doc1.InsertPages(0, Doc2, Pg, 1, 0)
'---save this single page as the new pdf
Doc1.Save(1, pdfOut + "\" + Split(fn, ".")(0) + "_" +
Pg.ToString + ".pdf")
Doc1.Close()
Next
Doc2.Close()
Next '(listview item)
'---cleanup
Try
AcroApp = Nothing
Doc1 = Nothing
Doc2 = Nothing
Catch
etc
End Try
many thanks. JDP.
|
|
0
|
|
|
|
Reply
|
barcrofter
|
2/10/2008 5:32:33 PM
|
|
" I thought that maybe my Adobe 8.0 standard had no JSO "
You may check it. Simple save my script as split.vbs and doubleclick.
However, the most examples you will find in the acrobat JS helpfile.
Therefore, for me the best way to automize acrobat is to execute JS
direct. You can use the scripts from inside and outsite and you don't
have to invent the wheel new.
For simple split and merge I use the freeware commandline tool
"mbtPdfasm.exe". It's simple to use and everyone can use your scripts
whithout having expensive software. I prefer it compared to pdftk,
because it can read and write bookmarks.
Good luck, Reinhard
|
|
0
|
|
|
|
Reply
|
ReFOB
|
2/11/2008 12:42:12 AM
|
|
|
11 Replies
920 Views
(page loaded in 0.106 seconds)
|