XDoc.PDF
Features
Tech Specs
How-to C#
Pricing
C# PDF: How to PDF Create PDF Export File and Page Process PDF Read PDF Write Form Process Document Protect Annotation & Drawing PDF Print Work with Other SDKs Barcode Read Barcode Create OCR Twain

C# PDF Convert to SVG SDK
How to read, extract, convert PDF to SVG text files using C#.net. Free open source examples.


C# Programming Language to Render & Convert PDF to SVG Using C#.NET XDoc.PDF Converter Control










  • Best C#.NET PDF converter control for converting adobe PDF to SVG file in Visual Studio .NET project
  • Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint
  • Written in managed Visual C# code and compatible with .NET Framework 2.0 or above
  • 100% clean .NET solution for PDF to SVG conversion using .NET-compliant C# language
  • Easily define a PDF page from multi-page PDF document and convert it to SVG file using C#
  • Instantly convert all PDF document pages to SVG image files in C#.NET class application
  • Perform high-fidelity PDF to SVG conversion in both ASP.NET web and WinForms applications
  • Support converting PDF document to SVG image within C#.NET project without quality loss
  • C# sample code for quick integration in .NET framework program for exporting PDF from SVG


In some situations, it is quite necessary to convert PDF document into SVG image format. Here is a brief introduction to SVG image. SVG, short for scalable vector graphics, is a XML-based file format used to depict two-dimensional vector graphics. As SVG images are defined in XML text lines, they can be easily searched, indexed, scripted, and supported by most of the up to date web browsers. Therefore, in C#.NET web document viewing applications, PDF is often rendered and converted to SVG image for high fidelity viewing.





C#.NET PDF DLLs and Demo Code: Convert PDF to SVG in C#.NET


This C# sample code describe how to convert PDF to SVG in .NET project.



        #region pdf to svg (one page)
        internal static void convertPdfPageToSvg()
        {
            String inputFilePath = @"";
            String outputDirectory = @"";
            PDFDocument doc = new PDFDocument(inputFilePath);
            int pageIdx = 0; //first page
            BasePage page = doc.GetPage(pageIdx);
            page.ConvertToVectorImage(ContextType.SVG, outputDirectory, "0", RelativeType.SVG);
        }
        #endregion

        #region pdf to svg (all page)
        internal static void convertPdfToSvg()
        {
            String inputFilePath = @"";
            String outputDirectory = @"";
            PDFDocument doc = new PDFDocument(inputFilePath);
            doc.ConvertToVectorImages(ContextType.SVG, outputDirectory, "fileName", RelativeType.SVG);
        }
        #endregion




C# convert two or multiple pdf files to svg (batch convert)


        #region pdf to svg (batch files and single tread)
        internal static void pdfFilesToSvg()
        {
            String inputDirectory = @"C:\input\";
            String outputDirectory = @"C:\output\";
            String[] files = Directory.GetFiles(inputDirectory, "*.pdf");
            foreach (String filePath in files)
            {
                int startIdx = filePath.LastIndexOf("\\");
                int endIdx = filePath.LastIndexOf(".");
                String docName = filePath.Substring(startIdx + 1, endIdx - startIdx - 1);
                PDFDocument doc = new PDFDocument(filePath);
                doc.ConvertToVectorImages(ContextType.SVG, outputDirectory, docName, RelativeType.SVG);
            }
        }
        #endregion