Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combining files into 1 pdf 1

Status
Not open for further replies.

chaosinc

Technical User
Sep 11, 2002
155
US
I am relatively new to the adobe game and have been dropped itno a pretty big job, and I deffinately need some help.
Ok I have a few quick questions:
1)I am looking at getting in the neigborhood of 2.7 million pdfs and would like to combine them into several larger pdfs.

2) I also need to find a way to insert a small image into these files. (omr marks for an intelligent inserter)

3) Also I need to know if there is a way to isert feed commands into the print files. there are 3 different stocks that need to be printed on for this project.

knoweldge is power, spread the power
 
You can accomplish step 1, search this forum for multiple threads on the topic of combining files.

You cannot (to my knowledge) insert graphics via the Acrobat products.

You cannot insert job control commands.

I would look at a workflow tool, something that perhaps emits PPML.

If this project came to me, my approach would be to automate the conversion of PDF to EPS, then author PostScript that placed the EPS, plus any additional graphics, onto a page, with device control commands passed in via setpagedevice.

I'm just trying to illustrate that your task is possible, but probably not with Acrobat.

Thomas D. Greer
 
As for the image thing, I've had success creating a PDF with the new image in it, selecting it using the Touch-Up Object Tool, copying it, and then pasting it into a different PDF.

Rick Henkel
Senior Systems Developer
 
2.7 Million is alot!!!

Step One: Use a product called PDF merge.

Step Two : if the image is not overlapping any text,
you could create you own stamp and use that.
Or Enfocus Pitstop has a watermark feature which you can ad you own image to, which will do every page in the PDF

Step three: Can't help you on that one...sorry
 
I have programmatically inserted graphics into pdf's by creating an icon and setting the file name on a case by case basis using forms automation.
I found out the hard way that to merge pdf documents into one pdf, each pdf must have different field names, or you must first convert the pdf to a postscript file, convert back to pdf and then merge. It was ugly.
 
ok well thanks for the help guys,
and i had a little typo when i first posted.
it's not 2.7 million.
it seems as i look at the data again that it is 7.2 million accounts.
i will let you know how things are progressing and thanks again for pointing me in these directions

knoweldge is power, spread the power
 
Try this:
(I think acrobat might need to be open before running)
****************************************************************************
* PROGRAM NAME: PDFMerger
*
* AUTHOR: Richard A. Schummer, January 2002
*
* COPYRIGHT © 2002 All Rights Reserved.
* Richard A. Schummer
* Geeks and Gurus, Inc.
* 42759 Flis Dr.
* Sterling Heights, MI 48314-2850
*
* raschummer@geeksandgurus.com
* rick@rickschummer.com
* *
* Free for the use by all FoxPro developers around the world!
*
* SYSTEM: Utilities
*
* PROGRAM DESCRIPTION:
* This program will merge two PDF files together into a third
* PDF file. Files are merged in the order they are sent to
* the procedure, see the parameters for the PDF file names.
*
* Adapted from Visual Basic Sample JoinAllAcrobatDocsInDir()
* Author : A Round Table Solution
* E-Mail: info@aroundtablesolution.com
*
* CALLED BY:
* DO PDFMerge with <tcPDFOne>, <tcPDFTwo>, ;
* [<tcPDFCombined>, <tlShowAcrobat>]
*
* INPUT PARAMETERS:
* tcPDFOne = Character, required, first PDF file. Can be
* fully pathed, relatively pathed, or no path
* will default to the current VFP directory.
* tcPDFTwo = Character, required, second PDF file. Can be
* fully pathed, relatively pathed, or no path
* will default to the current VFP directory.
* tcPDFCombined = Character, optional, combined PDF file. Can be
* fully pathed, relatively pathed, or no path
* will default to the current VFP directory. If
* no file name is passed, it will default to
* &quot;combined.pdf&quot; and be placed in the directory
* of the first PDF file passed in (tcPDFOne)
* tlShowAcrobat = Logical, optional, determines if the Acrobat
* utility is displayed on the screen. Defaults
* to not display.
*
* OUTPUT PARAMETERS:
* Character string returned with Error message, or null string
* if the process ran to completion.
*
* TABLES ACCESSED:
* None
*
* GLOBAL VARIABLES REQUIRED:
* None
*
* GLOBAL PROCEDURES REQUIRED:
* None
*
* CODING STANDARDS:
* Version 3.0 compliant with no exceptions
*
* TEST INFORMATION:
* None
*
* SPECIAL REQUIREMENTS/DEVICES:
* None
*
* FUTURE ENHANCEMENTS:
* None
*
* LANGUAGE/VERSION:
* Visual FoxPro 6.0 or higher
*
****************************************************************************
*
* C H A N G E L O G
*
* Date Dev Version Description
* ---------- --- ------- ------------------------------------------------
* 01/13/2002 RAS 1.0 Created program
* --------------------------------------------------------------------------
*
****************************************************************************

LPARAMETERS tcPDFOne, tcPDFTwo, tcPDFCombined, tlShowAcrobat

#DEFINE ccSAVEFULL 0x0001

LOCAL loAcrobatExchApp, ;
loAcrobatExchPDFOne, ;
loAcrobatExchPDFTwo, ;
lnLastPage, ;
lnNumberOfPagesToInsert, ;
lcOldSafety

DO CASE
CASE VARTYPE(tcPDFOne) # &quot;C&quot;
RETURN &quot;First PDF file parameter not passed as a character&quot;
CASE VARTYPE(tcPDFTwo) # &quot;C&quot;
RETURN &quot;Second PDF file parameter not passed as a character&quot;
OTHERWISE
* All is well on the parameter checks
ENDCASE

tcPDFOne = FORCEEXT(tcPDFOne, &quot;PDF&quot;)
tcPDFTwo = FORCEEXT(tcPDFTwo, &quot;PDF&quot;)

IF FILE(tcPDFOne)
IF FILE(tcPDFTwo)
* Nothing to do, both files exist
ELSE
RETURN tcPDFTwo + &quot; does not exist&quot;
ENDIF
ELSE
RETURN tcPDFOne + &quot; does not exist&quot;
ENDIF

IF VARTYPE(tcPDFCombined) # &quot;C&quot;
tcPDFCombined = ADDBS(JUSTPATH(tcPDFOne)) + &quot;combined.pdf&quot;
ENDIF

tcPDFCombined = FORCEEXT(tcPDFCombined, &quot;PDF&quot;)

WAIT WINDOW &quot;Combining &quot; + tcPDFOne + &quot; with &quot; + tcPDFTwo + ;
&quot; into &quot; + tcPDFCombined + &quot;, please wait...&quot; NOWAIT NOCLEAR

lcOldSafety = SET(&quot;Safety&quot;)
SET SAFETY OFF
ERASE tcPDFCombined
SET SAFETY &lcOldSafety

* Get appropriate references to Acrobat objects
loAcrobatExchApp = CREATEOBJECT(&quot;AcroExch.App&quot;)
loAcrobatExchPDFOne = CREATEOBJECT(&quot;AcroExch.PDDoc&quot;)
loAcrobatExchPDFTwo = CREATEOBJECT(&quot;AcroExch.PDDoc&quot;)

* Show the Acrobat Exchange window
IF tlShowAcrobat
loAcrobatExchApp.Show()
ENDIF

* Open the first file in the directory
loAcrobatExchPDFOne.Open(tcPDFOne)

* Get the total pages less one for the last page num (zero based)
lnLastPage = loAcrobatExchPDFOne.GetNumPages() - 1

* Open the file to insert
loAcrobatExchPDFTwo_Open(tcPDFTwo)

* Get the number of pages to insert
lnNumberOfPagesToInsert = loAcrobatExchPDFTwo.GetNumPages()

* Insert the pages:
* InsertPages(nInsertPageAfter As Numeric, iPDDocSource As Object, ;
* nStartPage As Numeric, nNumPages As Numeric, ;
* bBookmarks As Numeric) As Numeric
* Inserts pages into a file.
loAcrobatExchPDFOne.InsertPages(lnLastPage, loAcrobatExchPDFTwo, 0, lnNumberOfPagesToInsert, .T.)

* Close the document
loAcrobatExchPDFTwo.Close()

* Save the entire document, saved as file passed as third
* parameter to program using SaveFull (0x0001).
loAcrobatExchPDFOne.Save(ccSAVEFULL, tcPDFCombined)

* Close the PDDoc
loAcrobatExchPDFOne.Close()

* Close Acrobat Exchange
loAcrobatExchApp.Exit()

* Need to release the objects
RELEASE loAcrobatExchPDFTwo
RELEASE loAcrobatExchPDFOne
RELEASE loAcrobatExchApp

WAIT CLEAR

RETURN SPACE(0)

ENDPROC
 
yaacov,
thanks for the vfp code there.
it works alot faster with acrobat open than with it closed.
one of my other programmers may have figured out a way based on pdfmerge to have an entire directory merge.

so that part of the problem is done

as for the omr marks and different paper feed problems it also looks like we have found solutions there too.

we are outputting the pdf to pcl and inserting feed commands into the print stream as well as incorporating image calls for the omrs.

once again thank you for the help everyone.



knoweldge is power, spread the power
 
although for the adding an image to a pdf there are a few other progs out there that will let you acomplish this.
one of the solutions i came up with is a prog called backgrounder ,i believe, but it will let you merge 2 pages into 1. the way this worked was to create the omr marks as a background pdf and then merge the data pdf with the background pdf. the main drawback with this solution was the fact that i had to process the huge amounts of files once to get the omrs on the original pdfs and then run the whole mess through the merge program. with the sheer amount of files involved this was going to be time prohibitive and resource intensive.

also using a watermark prog or inserting a stamp also had the same type of results.

while reprocessing the pcl file after the pdfmerge is a two step procedure as well, it is oh so much faster and more flexible for our needs.

once again thank you all for pointing me down a good road.


knoweldge is power, spread the power
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top