Merging files in VBscript

Hello, all.
I have a question regarding using VBscript and using the adobe acrobat SDK. I'm fairly new at using it, so I'm sure i'm missing something important. I have acrobat 9 pro installed, and I've read over the API documentation and I have set up the following code:
function(){return A.apply(null,[this].concat($A(arguments)))}
call main
sub main
    Dim app
    Set app = CreateObject("AcroExch.App") 
    Dim srcDoc, destDoc
    Set srcDoc = CreateObject("AcroExch.PDDoc")
    Set destDoc = CreateObject("AcroExch.PDDoc") 
    dim test, test2
    srcPath = "C:\1.pdf"
    srcPath2 = "C:\2.pdf"
    destPath = "C:\3.pdf"
    test = destDoc.Create
    if test = -1 then
        srcDoc.Open srcPath
        destDoc.InsertPages -1, srcDoc, 0, srcDoc.GetNumPages(), 1
        srcDoc.close
        srcDoc.Open srcPath2
        destDoc.InsertPages -1, srcDoc, 0, srcDoc.GetNumPages(), 1
        destDoc.Save PDSaveFull, destPath
    end if
    srcDoc.Close
    destDoc.Close
    app.Exit
end sub
The code functions without error, however, the destDoc.save doesn't actually save anything. It even returns true as if it saved correctly, but the pdf file is just not there (in "C:\3.pdf"). I checked on the page count of destDoc before saving and it has the correct number of pages (a combined amount from 1 and 2) so i assume it merged the two documents successfully. Does anyone know why this would be? Also, sorry if this is in the wrong section, i wasnt sure if this should go here or in the acrobat scripting forum.
Thanks in advance!

Simple merge VBS.
For a little bit more look at: https://groups.google.com/group/adobe.acrobat.sdk/browse_thread/thread/6842ae988adee7c5/1e 8301171db34aa8?hl=de&lnk=gst&q=Reinhard%2BInsert#1e8301171db34aa8
HTH, Reinhard
merge.vbs
call main
sub main
    Dim app
    Set app = CreateObject("AcroExch.App") 
    Set baseDoc = CreateObject("AcroExch.PDDoc")
    Set insertDoc = CreateObject("AcroExch.PDDoc") 
    srcPath = "C:\file01.pdf"
    srcPath2 = "C:\file02.pdf"
    destPath = "C:\file03.pdf"
    baseDoc.Open srcPath
    insertDoc.open srcPath2
    baseDoc.InsertPages -1, insertDoc, 0, baseDoc.GetNumPages(), 1
    baseDoc.Save &H1, destPath
    app.CloseAllDocs
    app.Exit
end sub

Similar Messages

  • How to merge two columns in csv file using vbscript?

    How i can merge two column in csv file using vbscript or powershell?
    1  , 2  , 3  , 4  , 5
    1  , 23 ,  4 ,  5
    thanks

    Here are two examples
    http://msdn.microsoft.com/en-us/library/ms191250.aspx
    calulated
    http://msdn.microsoft.com/en-us/library/ms191250.aspx
    Gary Newman MCSE, MCT, CCNA, MCSD, MCPD, MCDBA, MCAD, MCSA, MCTS Developer and Administrator On SharePoint 2013 SharePoint Practice Manager for AmeriTeach Denver, CO.

  • Open the "Merge Files into a Single PDF" utility via script or exe?

    Greetings:
    I'm trying to find a method to open the Merge Files into a Single PDF utilty without opening Acrobat first.  Does anyone have some example code on how to open this dialog window?  It doesn't matter what language it is in, I can do the legwork to translate it to something I can understand.
    Ideally, I'd like to open the combine/merge window through an EXE or VBScript and pass it a handful of filenames that would appear in the programs list to process.
    Any help would be *GREATLY* appreciated.
    Thanks,

    Hi,
    As far as I am aware it is not possible to pass a list of files to this dialog using any API in Acrobat.
    You could however create your own VB .net application that has a mutli file select dialog box and the use the JSObject to merge all those files and open the resultant file in Acrobat.
    There are samples in the Acrobat SDK that show how to use the JSObject and the JavaScript function you could use to perform the merge are in the SDK documentation, I would start with investigating "insertPages".
    Please note that using the Acrobat SDK requires the Acrobat program to be installed and it will also need to be running in order to convert the files.
    Hope this helps
    Malcolm

  • Command line compiler (rhcl.exe) adds on rogue full pathways into [Merge Files] of .hhp

    I'm using RH 9 and generating chm outputs on my Win 7 64-bit computer.
    I have a core chm help file and several sub chm helps that get merged into it.
    I have a batch file that regularly compiles our help files locally and then copies them into a common local directory. It then copies them up to a mapped network drive where they are picked up by the nightly build of our installer.
    The problem I have, is that the command line compiler (rhcl.exe) is adding on a full pathway for all the sub helps listed in the [Merge Files] section of the core help's .hhp file, causing these problems:
    1) First of all, the pathways are wrong. The pathway it puts on is from the location of my .xpj file of my core help project. The output directory for the compiler is actually sending all the helps to a different local directory.
    2) These need to be relative, and should not have full pathways. The full pathways make it so that when I click on a subhelp TOC entry that subhelp's topic opens up in an entirely different window instead of merged into the core help's window. (See #13 on Peter's helpful site here about the problem with absolute paths: http://www.grainge.org/pages/authoring/rh9/using_rh9.htm)
    Here' what I want it to look like (the good):
    [MERGE FILES]
    pcdmisportable.chm
    pcdmistutor.chm
    pcdmisvision.chm
    pcdmislaser.chm
    pcdmiscmm.chm
    pcdmisUJB.chm
    pcdbasic.chm
    toolkitmodulesvwmp.chm
    pcdmisdci.chm
    toolkitmodules.chm
    pcdmisnc.chm
    pcdmisip.chm
    toolkitmodulesblade.chm
    pcdmisregistry.chm
    pcdmisfixturing.chm
    Here's what it looked like after the command line compile (the bad and the ugly):
    [MERGE FILES]
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmisportable.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmistutor.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmisvision.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmislaser.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmiscmm.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmisUJB.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdbasic.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\toolkitmodulesvwmp.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmisdci.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\toolkitmodules.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmisnc.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmisip.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\toolkitmodulesblade.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmisregistry.chm
    d:\hg\pcdmisqa\pcdlrn\help\corehelp\pcdmisfixturing.chm
    I've done the following ....
    I've checked my .xpj file and they have relative paths only.
    I've deleted my .cpd file.
    I've removed chm references from my rhbag.apj.
    ... and the hhp file still gets modified with pathways to my core project
    directory tacked on:
    It's strange; because if I compile without the command line, by opening the project and running the generation inside of RH, I don't get the problem where it re-writes the [Merge Files] section with the pathnames.
    Any ideas on where are these rogue full pathways coming from and how I can fix it? Or is it just a bug with the command line version of the compiler that Adobe will need to fix?

    I don't use command line generation but to the best of my knowledge, this has not been fixed.
    Please follow this link.
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Can you renumber pages in a merged file

    I often merge files from word and exel and other programs.  Can I renumber this new file

    You cannot delete pages in Reader on any platform. Reader is a reading app not an editing app.
    You can delete pages in Acrobat on Mac or Windows.

  • Gaps In between Letters Of Full Words When Merging Files To Single .pdf Adobe Acrobat 9.3.4 Pro

    Setup
    Windows XP SP3 + Office 2007 Pro
    Also, tested on  Windows 7 64x + Office 2007 Pro
    Same Issues.
    The steps used are:
    1) Open Adobe Acrobat 9.0
    2) Click File
    3) Combine
    4) Merge Files into a single PDF
    5) Add Files (select the required files)
    6) Combine Files (which then processes and creates single PDF)
    Results:
    A single PDF is then created and as mentioned is occasionally affected by this issue of random gaps appearing within words.
    Expected results:
    A single PDF with the same formatting and layout as the original files.
    I can not post screenshots of this issue for sercurity concerns but here is an example.
    From my word document / or pdf (either way)
    Drawing Contents
    Fabrication Notes
    Bill of Materials
    Assembly Notes
    Top Assembly Drawing
    Bottom Assembly Drawing
    Schematics
    After the Merging of the files
    Drawing Contents
    Fabri ation  ote
    Bi  of Materia
    A emb y  ote
    Top A  emb y Drawing
    Bottom A  emb y Drawing
    S hemati
    Seems like "C" "S" "N" "L"  's are missing
    EDIT: isn't constant, so its just not these letters its random
    Note: Tested this issue with Acrobat 8, and did not have this issue.
    Please Help
    Message was edited by: Bitzan

    Thanks for the response.
    I have checked though the Word documents that were used in the most recent merge. They don't have any spaces at these areas or strange formatting. I turned on the Show/Hide option to confirm if there was anything odd but I could not see anything. The formatting (Ctrl+D) shows the default font Arial, Regular, font 12.
    The interesting thing is that if it occurs and attempt another file merge the gaps are no longer there. Which makes me think this is unlikely to be the documents and formatting being used and more likely to be a bug in Adobe Acrobat.
    Is there anything else that might be of use to know?

  • Gaps inbetween letters of full words when Merging files to single PDF (Adobe Acrobat 9.0 Standard)

    I've raised a Bug Report although it says that I may not be contacted so thought someone else might have encountered this issue and hopefully knows what causes it and how to fix. Any advise would be greatly appreciated. Heres a copy of the Bug Report details...
    ******BUG******
    Concise problem statement:
    An intermitent issue is occuring when merging multiple files into a single PDF in Adobe Acrobat 9.0 Standard, the resulting PDF file has gaps inbetween the letters of actual words. For example the word "document" may appear in part of the PDF as "doc ument". This seems to affect various parts of the final PDF file.
    Setup: Windows XP SP2, Adobe Acrobat 9.0, Microsoft Office Standard Edition 2003
    Steps to reproduce bug:
    I am currently unable to replicate the issue on demand but this has happened three times since installing Adobe Acrobat 9.0 a month ago. The most recent occurance happened when merging 6 Microsoft Word Documents. It is a real problem due to the fact that every PDF created needs to be carefully checked and in some cases these PDFs have hundreds of pages.
    The steps used are:
    1) Open Adobe Acrobat 9.0
    2) Click File
    3) Combine
    4) Merge Files into a single PDF
    5) Add Files (select the required files)
    6) Combine Files (which then processes and creates single PDF)
    Results:
    A single PDF is then created and as mentioned is occasionally affected by this issue of random gaps appearing within words.
    Expected results:
    A single PDF with the same formatting and layout as the original files.

    Thanks for the response.
    I have checked though the Word documents that were used in the most recent merge. They don't have any spaces at these areas or strange formatting. I turned on the Show/Hide option to confirm if there was anything odd but I could not see anything. The formatting (Ctrl+D) shows the default font Arial, Regular, font 12.
    The interesting thing is that if it occurs and attempt another file merge the gaps are no longer there. Which makes me think this is unlikely to be the documents and formatting being used and more likely to be a bug in Adobe Acrobat.
    Is there anything else that might be of use to know?

  • Acrobat 9 Pro Merge Files Into Single PDF

    Just wanted to know if there's a way on Acrobat 9 Pro,i can select a folder using Merge Files Into Single PDF and have it merge each of the subfolders in the folder into separate single PDFs and have then retain the names of their corresponding subfolders? At the moment i'm having to do one folder at a time and then name them.
    Any help would be great

    Hi Bill
    Thanks so very much - you have solved the problem.
    I tried Document > Insert Pages and that worked.
    I then ran the "Repair" feature on Adobe which installed a few updates and I am now also able to merge pdf's by using the "Combine" feature and all the pages show the text/info.
    Thanks again for your help, it is very much appreciated.
    Thank you also to Apoorv for your assistance.

  • Help required for slicing and merging file

    Hi,
    I am working on p2p downloading application based on Gnutella. Right now i am trying to implement downlaoding one file from many hosts at a time(like limewire does). i am able to connect to multiple host. but dont know how to downlaod and merge file for his purpose.
    i know how to download one file from single host. but dont know how to handle file coming from multiple hosts.
    if anyone having knowledge, please tell as soon as possble.

    Hi.
    thanks for the reply. Actually i had something same
    in my mind. but unfortunately i am quite week in
    serializtion and file stuff. If you could provide me
    with code snipet for this, or can just simulate in a
    fewer lines of code, it would be a great help for
    me...i have too much short time...
    i think i really have to study this file
    stuff..........You shouldn't use serialization. Just invent a protocol, and "normal" binary data.
    Kaj

  • Acrobat Pro 9: "Merge files into a single pdf" creates blank pages

    I have a similar problem as a previous post (which hasn't been answered).
    I am able to pdf individual Word documents fine, but when I try to Combine > Merge files into a single pdf, the resulting pdf pages are all blank. I don't receive any error messages or have problems saving the file.
    I am using Adobe Acrobat Pro 9 (9.5.1) on Windows 7.
    The merging of pdf's hasn't worked at all since I installed the program.
    Any help would be much appreciated.

    Hi Bill
    Thanks so very much - you have solved the problem.
    I tried Document > Insert Pages and that worked.
    I then ran the "Repair" feature on Adobe which installed a few updates and I am now also able to merge pdf's by using the "Combine" feature and all the pages show the text/info.
    Thanks again for your help, it is very much appreciated.
    Thank you also to Apoorv for your assistance.

  • Acrobat Pro 9.4.5 crashes when merging files

    Is anyone else experiencing this? Adobe Acrobat Pro 9.4.5 works for while when merging files into a single PDF but then starts crashing when saving the mreged file. (MacBook Air, 10.6.7)

    how big is the PDF in MB (more or less according to the loose pages)?
    what happens if you save to desktop as xyz_2.pdf for eg.
    G

  • Multiple indesign files for product brochure one data merge file

    I have multiple indesign files for product brochure and there are price changes for various products.
    attached is a screen shot of the folder where all the indesign files are located as you can see each one has been laid out as a spread.
    Rather than opening each individual indesign file to amend prices can i quickly? or is there a way of compliling all documents into one file and quickly updating the price with the data merge file.
    thanks in advance.

    Absolutely not.
    (1)     PDF/VT-1 files must also be PDF/X-4 files. The “create PDF via distillation of PostScript” method precludes this since PostScript supports neither live transparency nor color management.
    (2)     The efficiencies of PDF/VT-1 require use of Forms XOjects and Image XObjects in the PDF file. That requires direct PDF creation that you get from PDF export. This is not available via any route that uses stink'in PostScript as an intermediary.
    (3)     Adobe most strongly endorses PDF creation from InDesign via the export function, not printing to PostScript and distilling. Such PostScript is optimized strictly for printing and not for PDF file creation.
              - Dov

  • Robohelp HTML command-line utility overwrites merged files in .hhp file with absolute paths. Any way to prevent this?

    I have a Robohelp 11 HTML project which uses merged CHM files. I have a help build script which compiles this project using the RH command-line utility. Whenever this runs, RH overwrites the names of the merged CHM files in the .hhp file to use absolute paths (even if the .hhp file is read-only!). I've searched Adobe forums and this appears to be a RH bug. In my case, it doesn't stop the project performing the merge, but it looks like it causes problems when searching the resultant parent CHM (topics matching the search simply don't show up in child projects), as the search cannot necessarily find the merged files referenced in the .hhp when someone performs the search on a different machine. I notice that if I compile via the RH UI, the .hhp entries are not overwritten. So, a workaround is to do the build manually. However, we'd like to automate our help build. Is there any way to prevent the command-line compiler overwriting the merge file entries in the .hhp?

    This was a problem with Rh9, see Item 13 at Using RoboHelp 9
    I haven't seen it reported since but maybe something at that link will help.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Add a line to end of the file using VBscript

    HI
    I am working with a software that only accept Vb script commands.
    I have a file that has 8 columns. I need to add a line at the end of the file using VB script
    I need this line to add numbers of amount column and put 22 in 7th column and leave the rest empty.
    example:
    2.01E+13
    77008900
    9.88
    6/3/2013
    1/14/2014
    1/17/2014
    2.01E+13
    77008900
    66.07
    6/5/2013
    1/14/2014
    1/17/2014
    added line
    66.07+9.88=75.95                                               
    22
    the files have different number of rows. please help

    why in the word you think you are smart as the fact is that you don't know shit.
    I explained to you that the software has the ability to edit the file using VBscript. Now if you cant do it dont say that it makes no sense. because others already help me to solve this.
    do everyone a favor and don't answer my questions please, Well you never answered any, don't post any nonsense comments
    I am sorry but I don't think any of us can understand what you are trying to ask.  What software?  VBScript is a scripting language that you use to write a script.  It cannot modify a file that is open by another process.
    We posted the suggestion to look into using the FileSystemObject to append a line to a file.  The examples show you how to do this.
    I suspect that the real problem is that, since you don't speak English natively, we are not understanding what you are trying to ask.  I know that, for me, what you are asking doesn't make sense. Another guess is that you have a program that is able
    to use VB to do things.  Is that what you mean by "softwares".  Are you saying that another program is written in VBScript and you want to modify it?
    You have to clarify these things.
    ¯\_(ツ)_/¯

  • Merging files and alert if file missing?

    Hi experts.
    I have a situation when I will pickup 5 files from different systems.
    The files will be merged into one file and have no problems with that I can use append in the file adapter.
    But here coems the problem. The merged file will be sent to the SAP sysmet at a specific timesrtamp and if a file i missing then we should send an alert or mail to notify the organisation that the file is missing.
    The notification has to be sent to the correct person according to what file is missing.
    We are using PI 7.40 Java only.
    Is the only way to go the new BPM?
    Is there anybody who has a guide on how to setup the new BPM?
    Regards
    Andreas

    Hi Raj,
    Raj Says..
    my doubt is Java map take input of all files as input or only one file it takes input.??
    Java Mapping will take one input file at a time as its input file and will process it.
    For three files at source folder; Java Mapping will be called threee times in XI.
    regards,
    Madan Agrawal

Maybe you are looking for

  • How can I listen to a text using Siri whilst phone is locked?

    Hi I have just been playing with my new 4s and I would like to listen to a text through my headphones whilst biking. But it's annoying as Siri says I need to unlock my phone first. Is there settings to overwrite this? Also why can't I listen to an ol

  • "Preview in Browser" only shows slices

    I'm been working on a mutli-page website mockup. When I add slices to my design and then select "Preview in Browser" ONLY the slices are showing up. Only when I delete the slices can I preview my whole design.  Ideas? For the life of me, can't seem t

  • File attributes problem in sFTP folder

    Hi, We are doing a Synchronous process (File - RFC - File). When the input file is placed in the input folder of sFTP location it is with the permission rw-r-r. We are not able to process this file. It is not able to pick up the file. We are only abl

  • Postings during MIRO reversal

    Hi Gurus, I have created a PO with account assignment (GL). *During MIGO entries are:* Acct  Assignemnt(GL)   + GR/IR                         - *During MIRO:* GR/IR                        + Vendor                       - But during MIRO reversal via

  • Authentucated smartcard user session is terminated immediatedly when card is removed, regardless of httpd SSLSessionCacheTimeout (default 300) setting. Why?

    I have installed security device in FF option/advanced tab. Then using smart card to log into my server. The smartcard user is authenticated and secure connection is going smoothly. When the card is removed from the card reader, the connection is imm