🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / C# RMOS / pdf birleştirme

1-) C# RMOS - pdf birleştirme

 

kaynak : https://docs.devexpress.com/OfficeFileAPI/119760/pdf-document-api/document-manipulation/merging-documents

 

ilk olarak C:\Program Files (x86)\DevExpress 19.1\Components\Bin\Framework\DevExpress.Docs.v19.1.dll i yükle ardından Form'a pdfviewer(dll'leri yüklemesi için) sürükle bırak.

 

 

using DevExpress.Pdf;

using System;

using System.Windows.Forms;

namespace WindowsFormsApp3

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        private void Form1_Load(object sender, EventArgs e)

        {

            using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())

            {

                pdfDocumentProcessor.CreateEmptyDocument("birlestir.pdf"); // exe'nin oldugu yere oluşturur

                pdfDocumentProcessor.AppendDocument("1.pdf"); // exe'nin oldugu yerdeki pdf

                pdfDocumentProcessor.AppendDocument("2.pdf"); // exe'nin oldugu yerdeki pdf

                pdfDocumentProcessor.Print(new PdfPrinterSettings()); // varsayılan yazıcıya print gönderir

            }

            pdfViewer1.LoadDocument("birlestir.pdf"); // pdfviewer eklemiştim forma

        }

    }

}

 

 

1-) C# RMOS - Diğer örnek

 

 

string[] pdfPath = new string[43];

 

            using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())

            {

                pdfDocumentProcessor.CreateEmptyDocument("merge1.pdf");

 

                for (int i = 0; i < 42; i++)

                {

                    int s = i + 1;

                    pdfPath[i + 1] = "al\\a (" + s + ").pdf";

 

                    pdfDocumentProcessor.AppendDocument(pdfPath[i+1]);

 

               }

            }

 

 

 

 

olması gereken .dll'ler

 

 

 2021 Ocak 18 Pazartesi
 419