> ## Content Index
> Fetch the complete content index at: https://mennankose.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# C# ile SVG'den PDF'e Dönüştürme
- URL: https://mennankose.com/c-ile-svgden-pdfe-donusturme/
- Published: 2014-02-23T19:54:50.000Z
- Updated: 2026-10-29T05:26:30.000Z
- Author: Mennan Köse
- Tags: C#, #Import 2026-11-06 07:43

C# ile SVG ile oluşturulan grafikleri PDF çevirmek için internette pek çok 3\. parti kütüphaneler bulunmaktadır. Ancak bu kütüphanelerin çoğu ücretlidir.

[Inkscape](http://inkscape.org/?ref=mennankose.com) ücretsiz bir vektörel grafik yazılımıdır. Inkscape’i komut satırından çalıştırarak çeşitli işlemleri yaptırabiliyoruz. Bizde uygulamamız içerisinden Inkscape’i çalıştırarak SVG formatındaki dosyalarımızı PDF formatına çevirebiliriz.

İlk önce [buraya](http://inkscape.org/en/download/?ref=mennankose.com) tıklayarak Inkscape’i bilgisayarımıza indiriyoruz. Daha sonra Visual Studio üzerinde bir Windows Form projesi açalım ve projemizin ana dizinine Inkscape klasörünü kopyalayalım. Aşağıdaki şekilde formumuzu tasarlayalım.

![form](https://cdn.synaps.media/mennan/content/images/2019/08/form.jpg)

Formu bu şekilde tasarladıktan sonra aşağıdaki şekilde kodlarımızı yazalım.

```csharp
using System;
using System.Diagnostics;
using System.Windows.Forms;
 
namespace SVGtoPDF
{
    public partial class Form1 : Form
    {
        string SVGFile = String.Empty;
        string PDFFile = String.Empty;
 
        public Form1()
        {
            InitializeComponent();
        }
 
        private void btnSVGSec_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dialog = new OpenFileDialog())
            {
                if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    SVGFile = dialog.FileName;
                    txtSVG.Text = SVGFile;
                }
            }
        }
 
        private void btnPDF_Click(object sender, EventArgs e)
        {
            using (SaveFileDialog dialog = new SaveFileDialog())
            {
                if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    PDFFile = dialog.FileName;
                    txtPDF.Text = PDFFile;
                }
            }
        }
 
        private void btnDonustur_Click(object sender, EventArgs e)
        {
            ProcessStartInfo processInfo = new ProcessStartInfo();
            processInfo.FileName = Environment.CurrentDirectory + "\\Inkscape\\inkscape.exe";
            processInfo.Arguments = String.Format("--without-gui --export-pdf=\"{0}\" \"{1}\"", txtPDF.Text, txtSVG.Text);
            processInfo.WindowStyle = ProcessWindowStyle.Hidden;
 
            Process process = Process.Start(processInfo);
            process.WaitForExit();
 
            MessageBox.Show("Dönüşüm tamamlanmıştır.");
        }
    }
}

```

Yazdığımız kodda Inkscape’i çalıştırdığımız argümanlar önemlidir. **–without-gui** Inkscape’in GUI modunda açılmamasını belirttik. **–export-pdf** parametresi ise PDF dosyanın nereye kaydedileceğini belirtir. Son parametre ise dönüştürülecek SVG dosyasını gösterir.