PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 6:51 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: merge files in vb.net
PostPosted: Fri Apr 23, 2021 4:28 pm 
Offline

Joined: Fri Apr 23, 2021 4:24 pm
Posts: 2
Hello,
is it possible to use pdfsharp with vb.net language?
I would just like to merge 2 PDF files but I cannot find samples in this language
thank you


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 25, 2021 12:26 pm 
Offline

Joined: Sat Jan 09, 2021 7:09 am
Posts: 18
PdfSharp is written in .Net so I'm 110% sure it can be used with VB.Net or any .Net language for that matter. Simply use a C# to VB.Net converter https://converter.telerik.com/ if you find a sample in C# that fits your needs.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 27, 2021 10:18 am 
Offline

Joined: Fri Apr 23, 2021 4:24 pm
Posts: 2
Thank you for helping
we can use pdfsharp with VB.NET


Top
 Profile  
Reply with quote  
PostPosted: Tue May 18, 2021 3:04 am 
Offline

Joined: Tue May 18, 2021 3:01 am
Posts: 1
Code:
Private Sub MergeMultiplePDFIntoSinglePDF(ByVal outputFilePath As String, ByVal pdfFiles As String())
        Dim document As PdfDocument = New PdfDocument()

        For Each pdfFile As String In pdfFiles
            Dim inputPDFDocument As PdfDocument = PdfReader.Open(pdfFile, PdfDocumentOpenMode.Import)
            document.Version = inputPDFDocument.Version

            For Each page As PdfPage In inputPDFDocument.Pages
                document.AddPage(page)
            Next
            'System.IO.File.Delete(pdfFile) '被防毒軟體擋下來,以後再改
        Next

        document.Options.CompressContentStreams = True
        document.Options.NoCompression = False
        document.Save(outputFilePath)
    End Sub


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group