Then assign the folder pathway of the folder with the pdf files that you would like to see inserted into your primary doc to inputDirectoryToScanForFile. The first file in the collection would be the file that you are inserting into, same as in first example. You can use something like below to generate the collection of documents to be inserted into your primary doc. I used this resource re method referencesĮDIT: Swapping the array for auto generated (mostly, the primary pdf still set by user) list of pathways to pdfs that you want to insert into the primary pdf) You need to have adobe acrobat installed / operational. OK = primaryDoc.Save(PDSaveFull, arrayFilePaths(0))ĭebug.Print "PRIMARYDOC SAVED PROPERLY: " & OK OK = primaryDoc.InsertPages(numPages, sourceDoc, 0, numberOfPagesToInsert, False)ĭebug.Print "PAGES INSERTED SUCCESSFULLY: " & OK NumberOfPagesToInsert = sourceDoc.GetNumPages OK = sourceDoc.Open(arrayFilePaths(arrayIndex))ĭebug.Print "SOURCE DOC OPENED & PDDOC SET: " & OK Set sourceDoc = CreateObject("AcroExch.PDDoc") Set primaryDoc = CreateObject("AcroExch.PDDoc")ĭebug.Print "PRIMARY DOC OPENED & PDDOC SET: " & OKįor arrayIndex = 1 To UBound(arrayFilePaths) If objCAcroPDDocDestination.InsertPages(objCAcroPDDocDestination.GetNumPages - 1, objCAcroPDDocSource, 0, objCAcroPDDocSource.GetNumPages, 0) Then ObjCAcroPDDocSource.Open ThisWorkbook.Path & "pathwithpdfs" & PDFfileName 'Open the source document that will be added to the destination PDFfileName = Dir(ThisWorkbook.Path & "firstpdf" & n & ".pdf") I get no error msg but perhaps I am missing parts.Īny help would be appreciated. I have tried something like, but cannot seem to get it to work. I would like to not use a plug in tool and have tried with acrobat api below. Without knowing what arguments you pass to the batch diagnosing is impossible.%* is replaced with all arguments you pass, the location of the output is determined by the path of the first argument %~dp1Ġ Verzeichnis(se), 1.049.452.544 Bytes freiĪnd after (I named the batch SO_50728273.cmd): > SO_50728273.cmd a:\*.pdfĠ Verzeichnis(se), 1. am trying to combine PDF's into one single pdf with the use of vba. an eventually existing binder.pdf is renamed to Įcho %~a1|findstr "d" 2>&1>Nul & Pushd "%~f1" || Pushd "%~dp1"Įcho No arguments, need a path& pause & goto :Eof.processes all pdf files in that folder combining them into binder.pdf.the following batch will change to the referenced folder and.If you drag'n drop file(s) or a folder to the batch or pass at least one file/folder.pdf files in sequence.Įx.: 1.pdf 2.pdf 3.pdf.is the sequence i want, but the command merge in this way: 1.pdf 3.pdf 2.pdf 7.pdf. Ok, the command pdftk *.pdf cat output combined.pdf worked now, but it doesn't merge the. I need that the program process all the files even are missing one or more. Pdftk fbw1.pdf fbw2.pdf fbw3.pdf fbw4.pdf fbw5.pdf fbw6.pdf fbw7.pdf fbw8.pdf fbw9.pdf fbw10.pdf fbw11.pdf fbw12.pdf fbw13.pdf fbw14.pdf fbw15.pdf fbw16.pdf fbw17.pdf fbw18.pdf fbw19.pdf fbw20.pdf fbw21.pdf fbw22.pdf fbw23.pdf fbw24.pdf fbw25.pdf fbw26.pdf fbw27.pdf fbw28.pdf cat output testieee.pdf >nul 2>nulįor example: If i don't have the file fbw1.pdf into the directory, it won't process anything. If don't have the file that is in the command, it won't process. Guys, this simple command are working fine for me, with only one problem. bat script and the pdftk.exe with it libiconv2.dll are all in the same folder.Ĭan someone help me? I need merge all the. Pdftk.exe %command% cat output "%~dp1binder.pdf" bat it isn't working.įOR %%A IN (%*) DO (set command=!command! %%A) bat script that works together with Pdftk program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |