Questions tagged [pdfsharp]

PDFsharp - A .NET library for processing PDF (create, merge, split, or modify PDF files). For questions related to using the PDFsharp library on any platform and with any programming language.

PDFsharp is the Open Source .NET library that easily creates and processes PDF documents on the fly from any .NET language. The same drawing routines can be used to create PDF documents, draw on the screen, or send output to any printer.

PDFsharp’s outstanding features

Here are just a few highlights:

  • Creates PDF documents on the fly from any .NET language
  • Easy to understand object model to compose documents
  • Newly designed from scratch and written entirely in C#
  • One source code for drawing on a PDF page as well as in a window or on the printer
  • Modify, merge, and split existing PDF files
  • Images with transparency (color mask, monochrome mask, alpha mask)
  • Font embedding and subsetting
  • The graphical implementation based either on GDI+ or WPF

PDFsharp Resources

Questions

Use this tag for all questions that relate to using the PDFsharp library.

MigraDoc is a different library from the same authors. MigraDoc includes PDFsharp and uses PDFsharp to create PDF files. Not all questions about MigraDoc justify the PDFsharp tag.
It is less confusing for people trying to answer your questions when you use the tag that corresponds to the API you are using (either or ). Simply look at the namespace of the objects you are using.

For questions about the HTML Renderer for PDF using PdfSharp use the tag.

Related Tags

, ,

Orthography

The name of the library is PDFsharp. When used for namespaces the name is written as PdfSharp following C# naming conventions. So unless you are referring to a namespace, the recommended writing is PDFsharp.

886 questions
-2
votes
2 answers

Unable to convert PCL file to PDF using Filestream and PDFSharp

I was unable to find a free library which can directly convert PCL file to PDF file, i had a thought of reading the PCL file into FileStream and saving it to a PDF document using PDF Sharp. I tried the following code, but it gives me a blank PDF…
WorksOnMyLocal
  • 1,617
  • 3
  • 23
  • 44
-2
votes
2 answers

How can I split a corrupt pdf file using C#

I am trying to split a 'n' paged pdf file to 'n' number of pdf files containing 1 page each in ".net". For normal pdf files, PDFSharp is working fine but for corrupt file its showing errors listed down. When I use Adobe Reader and 'Save As' the…
-2
votes
1 answer

fixeddocument to pdf by pdfsharp 1.32

I want to save the fixeddocument to pdf file in wpf c#4.0, I use pdfsharp version 1.32,it has no Xps module, how can I transfer to pdf
wwsinsh
  • 30
  • 3
-2
votes
1 answer

'' is not a valid code for a 3 of 9 standard bar code

I would like to generate a barcode using the .NET PDFSharp library. I'm creating a Barcode instance BarCode barcode = new Code3of9Standard { Text = content, // example: 'this text will be converted to a barcode' StartChar = '*', EndChar…
user9945420
-2
votes
2 answers

PDFsharp: How to find the Size dimensions of all the pages in a PDF file?

I am using PDFsharp, a great tool for working with PDFs. I am writing an application in VB.net to work with PDFs for the printing industry. I need to know how to find out the dimensions of each page of the PDF.
-2
votes
1 answer

Value cannot be null. Parameter name: elementId in PDFsharp

I am working on Export to PDF funtionality using C# and PDFSharp. I am getting this error: Value cannot be null. Parameter name: elementId The error is on this line : PdfDocument document = PdfGenerator.GeneratePdf(htmlcontenttbl.ToString(),…
User_2235
  • 39
  • 2
  • 11
-2
votes
1 answer

Remove underlines from text in PDF file

I have a bunch of PDF files with broken links. I need to remove those links and right now I can do the following: Remove link actions Change text color from blue to black What I can't do is to remove blue underlines below text that was a link…
Anubis
  • 2,484
  • 2
  • 22
  • 33
-2
votes
1 answer

Either 'GDI', 'WPF' or 'SILVERLIGHT' must be defined how to remove this error?

I have been working on a project in Visual Studio, C# language and I found an error described above. How can I remove this error? "Either 'GDI', 'WPF' or 'SILVERLIGHT' must be defined"
-2
votes
1 answer

How can I create jpeg images(image per page) from a pdf using PDFSharp?

I am currently using GhostScriptSharp to create jpeg images from pdf documents. And I am facing permission issues. So I wanted to move on to PDFSharp for creating images. I tried that as specified their wiki page, but that example is not complete,…
sovan
  • 479
  • 6
  • 21
-2
votes
2 answers

Create PDF and send mail on scheduled task fails

I created a scheduled task that is supposed to scrape data from a website, store this in the database, create a daily pdf and send a weekly mail. The first 2 parts run smoothly, but it seems that the other 2 are skipped regardless of what I try to…
Dieter B
  • 1,142
  • 11
  • 20
-2
votes
1 answer

How do I set a table background color in a PDF file with MigraDoc?

MigraDoc.DocumentObjectModel.Tables.Table tAzul = section.AddTable(); MigraDoc.DocumentObjectModel.Tables.Column colAzul = tAzul.AddColumnMigraDoc.DocumentObjectModel.Unit.FromCentimeter(20)); MigraDoc.DocumentObjectModel.Tables.Row rowAzul =…
user3357141
  • 199
  • 1
  • 3
  • 16
-2
votes
2 answers

How do I align a table in the section area with PDFsharp or MigraDoc?

How do I align a table in the section area? MigraDoc.DocumentObjectModel.Tables.Table tFirma = section.Footers.Primary.AddTable(); MigraDoc.DocumentObjectModel.Tables.Column cFirma =…
user3357141
  • 199
  • 1
  • 3
  • 16
-2
votes
1 answer

How to use Listinfo to create hierarchical list

I am trying to create a list that has another list inside it. Both lists are numbered and how do i manage the numbering For example i am trying to create a list as follows If you cannot see the image above then refer below List 1 item 1 List 1…
Sabareesh Kkanan
  • 1,201
  • 1
  • 14
  • 22
-3
votes
1 answer

Copy and resize a document and fit it into box

I'm using PDFsharp to create a PDF. I am trying to copy another document/image (PDF format with A3 size) and paste it within the image box, in the new document (A4 size). In the new document, there would be an image details box and an image box. So,…
saf21
  • 814
  • 1
  • 15
  • 32
-3
votes
2 answers

Is there any way to "sanitize" PDFs in C#?

What options are there for trying to remove viruses etc within a PDF? How is code hidden within PDFs? Can I remove at least the majority of it? I expect there to be holes still, but does it help to remove meta data like below? Stream stream = new…
Fred Johnson
  • 2,539
  • 3
  • 26
  • 52
1 2 3
59
60