Normal Topic Document printing via PDF (Read 1732 times)
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Document printing via PDF
Sep 2nd, 2010 at 6:19pm
Print Post Print Post  
We have a list of approximately 400 documents that a user can select from an assortment of tabs in our application.  Historically we have simply used MergeFilePrint to parse through whatever a user selects and pass those jobs on to a printer.  This has become cumbersome as these "batch" jobs can become extensive and the macro that controls this function must open and close Word each time a job is processed.  This results in multiple single print jobs that can be interrupted by other users printing to the same printer...hence...documents become interleaved and must then be hand colated.

I've tried a number of things such as printing first to a single PDF file from Word using CutePDF but this is slow. 

We are not merging any data into these 400 odd documents so WordMerge is not necessary, so I have been trying to experiment by converting the RTF docs that WordMerge uses to PDF and then use a different print mechanism such as CutePDF or PDFill to hand off the individual PDF documents and assemble them as one package that then can be passed to a printer...therby bypassing MS Word.

Does anyone know if this is possible...I, admitedly, am limited in my programming skills so have to once again cry "uncle.

As always, any and all help is greatly appreciated.

Thanks...Cliff
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Document printing via PDF
Reply #1 - Sep 2nd, 2010 at 7:42pm
Print Post Print Post  
Just to confirm...these are not merge documents, correct? You just want to print out a batch of selected static documents?

Also, which version of Word do you use?
« Last Edit: Sep 4th, 2010 at 3:35am by Hammer »  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Document printing via PDF
Reply #2 - Sep 10th, 2010 at 10:48pm
Print Post Print Post  
Why not print to PDF directly from Sesame?

If you have a PDF printer installed on your pc, then Sesame can print to it like a normal printer. (I have Adobe PDF installed and it works great.)

You can also create an 'alternateprinter' using sbasic and let the user choose which printer to print to, as needed.

Steve
  
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Document printing via PDF
Reply #3 - Sep 14th, 2010 at 3:57pm
Print Post Print Post  
To respond to Hammer's question: these are not merge documents and we are running Word 2007...
Thank you!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Document printing via PDF
Reply #4 - Sep 14th, 2010 at 6:31pm
Print Post Print Post  
Cliff wrote on Sep 14th, 2010 at 3:57pm:
To respond to Hammer's question: these are not merge documents and we are running Word 2007...
Thank you!


Can you send three or four of your document files to me at support@lantica.com? I have an evil scheme I'd like to test.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Document printing via PDF
Reply #5 - Sep 16th, 2010 at 5:38pm
Print Post Print Post  
Thanks for the sample files, Cliff.

OK, my evil scheme looks workable! I just did a proof statement, but it definitely works. A final version would need error handling and probably some management with regard to automatic page numbering, varying margins and suchlike.

Firstly, I made a text file with the list of files I want to assemble. Since you already have the list in SBasic, writing it out to a file is trivial. My file is called filelist.txt and looks like this:

AUTO002E 0195.rtf
CA0038 1202.rtf
CG0300 0196.rtf
CL0197 0101.rtf
CP0129 0304.rtf
CR0246 0807.rtf
CU0145 0900.rtf
IL0023 0702.rtf
IM1550 0105.rtf


I then created and saved an empty Word document. I put the following VBA macro in the document, which collects all the desired documents and assembles them into a single package that will print out as one print job. It will run when the document is opened:

Private Sub Document_Open()
Dim strListPath As String
Dim strDocPath As String
Dim strFile As String

    strListPath = "D:\Jobs\TempJobs\RTFCombine\filelist.txt"
    strDocPath = "D:\Jobs\TempJobs\RTFCombine\"

    Open strListPath For Input As #1
    Do While Not EOF(1)
       Line Input #1, sFile
       Selection.EndKey wdStory, wdMove
       Selection.InsertFile Chr(34) & strDocPath & sFile & Chr(34)
       Selection.EndKey wdStory, wdMove
       Selection.InsertBreak wdSectionBreakNextPage
    Loop
    Close #1
   
    ActiveDocument.PrintPreview

End Sub


The VBA sets a couple of paths, so I know where to find my files. It then opens my filelist.txt file and reads it in line by line. For each line, it moves to the end of the document, inserts the file, and adds a section break. The section break both creates a page break and also allows each inserted document to retain its column breaks and suchlike. When it's all done, it open the document in Print Preview so I can look at it. You can also have it print directly to the printer and then close itself.

As I said, the VBA would need polished up, but the concept is certainly doable.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Document printing via PDF
Reply #6 - Sep 16th, 2010 at 5:42pm
Print Post Print Post  
Thanks Hammer! We'll give this a whirl!
Very much appreciated.
  
Back to top
 
IP Logged