Code Monkey home page Code Monkey logo

pdftosvg.net's Introduction

PdfToSvg.NET Logo

Tests NuGet License MIT

PdfToSvg.NET

Fully managed library for converting PDF files to SVG. Potential usage is seamlessly embedding PDFs on your site without the need of a PDF reader.

๐Ÿš€ Test it online ย ย  ๐Ÿ  Homepage ย ย  ๐Ÿ“ฆ NuGet package ย ย  ๐Ÿ“œ Release notes

Features

  • Extracts text and images from PDF files into SVG.
  • Supports .NET 5, .NET Core 1.0, .NET Standard 1.6, .NET Framework 4.0 and later.
  • Focus on producing compact SVG markup ready for the web.
  • Almost dependency free.

State

There are PDF features not yet implemented by this library. Before using it, please do rigorous testing of PDFs from the PDF producer you intend to convert, to ensure it does not use any features not supported by PdfToSvg.NET.

๐Ÿ“– Read more about limitations

โš ๏ธ New versions of the library might include breaking changes to the public API until version 1.0 is released.

Quick start

Install the PdfToSvg.NET NuGet package.

PM> Install-Package PdfToSvg.NET

Open a PDF document by calling PdfDocument.Open. Call SaveAsSvg() on each page to convert it to an SVG file.

using (var doc = PdfDocument.Open("input.pdf"))
{
    var pageNo = 1;

    foreach (var page in doc.Pages)
    {
        page.SaveAsSvg($"output-{pageNo++}.svg");
    }
}

Note that if you parse the XML returned from PdfToSvg.NET, you need to preserve space and not add indentation. Otherwise text will not be rendered correctly in the modified markup.

Issues

Did the conversion fail? Before reporting an issue, please read the documentaton about current limitations. If you believe it is a bug, ensure the PDF file causing problems is attached in the issue.

pdftosvg.net's People

Contributors

dmester avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.