Avatar of Natavia Finnie
Natavia FinnieFlag for United States of America

asked on 

merging .pdf files using vb.net

Is there a way to merge multiple documents to print to 'Microsoft XPS Document Writer' or 'CutePDF Writer' using VB.NET?

I would like to try this method because even if I use a wait for process to complete, with the code attached, another print job could easily slip in-between.  The two printer methods listed above are currently on all the computers that will run this program.

I am trying to print a list of files including .docx and .pdf...  

the problem that I having is that when I go to print to the printer the order is not as expected.  I want the order to print in the order of the enclosure list, which when I debug, the order is correct. Just not going to the print que correctly.  I do not want to install a 3rd party .dll

Please help!!!!

enclosureList = [1]"C:\..\..\wordfile.docx"
                            [2]"C:\..\..\pdfFile_1.pdf"
                            [3]"C:\..\..\pdfFile_2.pdf"
                             ...
                            [11]"C:\..\..\pdfFile_10.pdf"
For x As Integer = 0 To enclosureList.Count - 1
                Dim psInfo As New ProcessStartInfo

                With psInfo
                    .UseShellExecute = True
                    .Verb = "print"
                    .FileName = enclosureList(x)
                    .WindowStyle = ProcessWindowStyle.Hidden
                    Process.Start(psInfo)
                End With
 Next                       

Open in new window

.NET ProgrammingDocument Imaging

Avatar of undefined
Last Comment
Michael Fowler
ASKER CERTIFIED SOLUTION
Avatar of Michael Fowler
Michael Fowler
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo