Welcome GuestLogin

PDFsharp and MigraDoc Wiki

RSS RSS

Navigation




Quick Search
»

PoweredBy

Visit the new Website for PDFsharp & MigraDoc Foundation 6.0 for .NET 6 and find information about the new version for Windows, Linux, and other platforms.

Search Engine

Here you can search through the pages of this Namespace, their attachments and the files uploaded to the system.
Note: the results will only display the items you have permissions to read.



Filter by Category

Select allNoneInvert










This search, performed through 421.52 KB (73 documents, 3477 words), completed in 0.0 seconds and yielded 30 results.

PDFsharp Sample: Unicode — 9.3%

^Up Next >> This sample shows how to use Unicode text in PDFsharp. Languages based on Latin, Greek, or Cyrillic letters should all work with PDFsharp. You'll find code snippets for the following classes: XPdfFontOptions XTextFormatter PDF Output File See the PDF file created by this sample: output.pdf (58 kB) Source Code Drawing the text is quite easy (just like the Text Layout sample): // Create new document PdfDocument document = new PdfDocument(); // Set font encoding to unicode XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, [...]

PDFsharp: Frequently Asked Questions — 9.1%

Questions and answers about PDFsharp See also: MigraDoc FAQs Questions and answers about PDFsharp What is PDFsharp PDFsharp is a .NET library for creating and modifying Adobe PDF documents programmatically. It is written in C# and can be used from any .NET language like VB.NET. Is PDFsharp based on or does it require other libraries or tools? PDFsharp is newly designed and built from scratch in C#. Neither Adobe's [...]

PDFsharp 1.30 Folders — 7.3%

[...] unfinished. Below you'll find the list of tasks that have to be done. We will provide information about PDFsharp 1.50 folders after the final version of PDFsharp 1.50 was released. Currently, PDFsharp 1.50 is still under construction and folders and samples will be rearranged for the final version. Folders of PDFsharp [...]

PDFsharp Articles — 5.3%

PDFsharp Articles PDFsharp: First Steps explains the Hello World sample. Graphics introduces the XGraphics objects that PDFsharp applications use for drawing. Object Streams provides information about a PDF feature that PDFsharp versions prior to 1.50 did not support. Form Objects shows how to use the XForm class to efficiently draw items that appear more than once. PDFsharp 1.

MigraDoc 1.30 Folders — 4.0%

[...] Below you'll find the list of tasks that have to be done. We will provide information about MigraDoc 1.50 folders after the final version of PDFsharp 1.50 was released. Currently, PDFsharp 1.50 is still under construction and folders and samples will be rearranged for the final version. Folders of MigraDoc Foundation 1.30 [...]

PDFsharp Sample: Graphics — 3.5%

[...] Guid.NewGuid().ToString("D").ToUpper()); s_document = new PdfDocument(); s_document.Info.Title = "PDFsharp XGraphic Sample"; s_document.Info.Author = "Stefan Lange"; s_document.Info.Subject = "Created with code snippets that show the use of graphical functions"; s_document.Info.Keywords = "PDFsharp, XGraphics"; // Create demonstration pages new LinesAndCurves().DrawPage(s_document.AddPage()); new Shapes().DrawPage(s_document.AddPage()); new Paths().DrawPage(s_document.AddPage()); new Text().DrawPage(s_document.AddPage()); new [...]

Supported Platforms and Technologies, Available Builds — 2.8%

The development of PDFsharp started with .NET 1.1. PDFsharp used the graphics functions of GDI+, a graphics library from Microsoft encapsulated in the System.Drawing namespace . The XGraphics class of PDFsharp has functions for drawing graphics and text very similar to the System.Drawing.Graphics class . The advantage of this approach is that PDFsharp was able to draw text and graphics not only in PDF documents, but on WinForms [...]

MigraDoc Sample: Hello MigraDoc — 2.6%

[...] MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(document, "MigraDoc.mdddl"); PdfDocumentRenderer renderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.Always); renderer.Document = document; renderer.RenderDocument(); // Save the document... string filename = "HelloMigraDoc.pdf"; renderer.PdfDocument.Save(filename); // ...and start a viewer. Process.Start(filename); } CreateDocument is the method that creates the content: public static Document CreateDocument() { // Create a new MigraDoc document Document document = new Document(); document.Info.Title = "Hello, MigraDoc"; [...]

MigraDoc Sample: Invoice — 2.6%

[...] The invoice document is created with the MigraDoc document object model and then rendered to PDF with PDFsharp. PDF Output File See the PDF file created by this sample: output.pdf (104 kB) Screen Shots Here is a sample screen shot: Source Code Creating the Document Nothing special here: public Document CreateDocument() { // Create a new MigraDoc document this.document = new Document(); this.document.Info.Title = "A sample invoice"; this.document.Info.Subject = "Demonstrates how to create an invoice."; this.document.Info.Author = "Stefan Lange"; DefineStyles(); [...]

PostScript fonts and PDFsharp — 2.5%

PDFsharp cannot use PostScript fonts to draw text in a PDF file. Only TrueType fonts and OpenType fonts with TrueType outlines can be used with PDFsharp. PDFsharp can open and manipulate existing PDF documents that contain PostScript fonts. The restriction applies only to text created with PDFsharp. Background The PostScript font technology was invented by Adobe in 1984. From 1990 to 2000 the Adobe Type Manager had to be installed to use PostScript fonts under Windows 3.x to Windows [...]

PDFsharp Sample: Combine Documents — 2.0%

[...] XGraphics.FromPdfPage(page1); box = page1.MediaBox.ToXRect(); box.Inflate(0, -10); gfx.DrawString(String.Format("{0} • {1}", filename1, idx + 1), font, XBrushes.Red, box, format); gfx = XGraphics.FromPdfPage(page2); box = page2.MediaBox.ToXRect(); box.Inflate(0, -10); gfx.DrawString(String.Format("{0} • {1}", filename2, idx + 1), font, XBrushes.Red, box, format); } // Save the document... const string filename = "CompareDocument1_tempfile.pdf"; outputDocument.Save(filename); Variant2: Imports [...]

Using Private Fonts — 1.8%

[...] are two methods, but not all platforms support both methods. IFontResolver IFontResolver is new with PDFsharp 1.50. It cannot be used with the GDI build of PDFsharp. It cannot be used with the WPF build of PDFsharp if you want to use the DocumentPreview - fonts used with IFontResolver are not available in the preview. For all other platforms (Silverlight, Windows Phone) this is the method of choice. XPrivateFontCollection XPrivateFontCollection is no longer supported and not recommended [...]

PDFsharp Sample: Font Resolver — 1.8%

[...] available fonts. Note: When using the GDI build, you can use the XPrivateFontCollection class. As of PDFsharp 1.50 beta 2, the XPrivateFontCollection class is the recommended way for applications that use the GDI build of PDFsharp and that also use the screen preview or use the XGraphics class to draw on other contexts beside PDF files. PDFsharp Sample: Private Fonts The method shown in this sample works for the WPF build, the Core build, and the Silverlight build. This method has [...]

PDFsharp Sample: Annotations — 1.8%

^Up Next >> This sample shows how to create PDF annotations. PDFsharp supports the creation of the following annotations: Text annotations Link annotations Rubber stamp annotations PDF Output File See the PDF file created by this sample: output.pdf (3 kB) Note: the red rubber stamp shows localized resources of Adobe Reader or placeholder if the resource cannot be found Screen Shots Here is a sample screen shot taken on a German Windows version: Note: the red rubber stamp shows the German text "Geheimsache" instead of "Top Secret" because localized [...]

Working with NuGet Packages — 1.8%

With PDFsharp 1.50 beta we have started to make preview versions of compiled assemblies available via NuGet before releasing the complete source code with samples etc. With Visual Studio you can install the NuGet Package Manager to easily access NuGet packages. This work with VS 2012 Express and also with the Community Editions of VS 2013 and VS 2015. Just open Visual Studio and go to "Tools" => "Extensions and Updates..." to install the NuGet Package Manager if you do not have it yet. To add PDFsharp or PDFsharp [...]

PDFsharp Sample: HelloWorld (VB) — 1.7%

[...] page, two lines, an ellipse, and the text "Hello, World!" written in its center. Nearly all samples of PDFsharp are written in C#. This is because C# is the language PDFsharp itself is written in and we, the developers of PDFsharp, choose C# as our favorite language. If you like to write your code in Visual Basic .NET or in any other .NET language, you can of cause use PDFsharp as well. Here is a similar C# version of Hello World . PDF Output File See the PDF file created by this sample: [...]

PDFsharp Sample: Work on Pdf Objects — 1.7%

[...] Next >> This sample shows how to deal with PDF objects that are not (yet) covered by specialized PDFsharp classes (as an example it adds an OpenAction to an existing PDF file). PDF documents are based internally on objects like dictionaries, arrays, streams etc. This sample shows how to work directly on these underlying PDF objects. Use this functionality to achieve PDF features that are not yet implemented in PDFsharp. PDF Output File See the PDF file created by this sample: output.pdf (90 kB) Note: the OpenAction causes Adobe Reader [...]

System Requirements — 1.7%

PDFsharp requires the .NET Framework 2 and is written entirely in C#. It was developed with Visual Studio 2012 and Visual Studio 2013, but should run on any C# compiler. The MSBuild utility that comes with the .NET Framework should be able to compile the solutions that are included with PDFsharp. The WPF [...]

MigraDoc Articles — 1.7%

MigraDoc Foundation Articles MigraDoc First Steps explains the Hello World sample. MigraDoc 1.30 Folders explains the folders that come with the source code ZIP. MigraDoc Known Issues lists known issues of MigraDoc Foundation. MigraDoc DDL introduces the MigraDoc Document Description Language used to persist MigraDoc documents. Spaces in MigraDoc Documents gives some tips about using spaces in MigraDoc. PageSetup, Headers, Footers gives some tips about using the [...]

Main Page — 1.5%

[...] to ' ' This Wiki provides you with information about these libraries. If you are unfamiliar with PDFsharp and MigraDoc, please visit these page: PDFsharp and MigraDoc Homepage PDFsharp and MigraDoc Overview introduces PDFsharp and MigraDoc and lets you decide which tool you need PDFsharp [...]

PDFsharp Web Sample: Clock — 1.5%

[...] PdfDocument document = new PdfDocument(); this.time = document.Info.CreationDate; document.Info.Title = "PDFsharp Clock Demo"; document.Info.Author = "Stefan Lange"; document.Info.Subject = "Server time: " + this.time.ToString("F", CultureInfo.InvariantCulture); // Create new page PdfPage page = document.AddPage(); page.Width = XUnit.FromMillimeter(200); page.Height = XUnit.FromMillimeter(200); // Create graphics object and draw clock XGraphics gfx = XGraphics.FromPdfPage(page); RenderClock(gfx); // Send PDF to browser MemoryStream stream = new MemoryStream(); [...]

Graphics — 1.3%

[...] the same code with the GDI+ or WPF classes. There are the following general differences between the PDFsharp X classes and the classes from System.Drawing: All floating point values are of type double to prevent the tedious casting to float necessary in GDI+/ System.Drawing X graphics classes and functions supports only functionality available in PDFsharp In the WPF build of PDFsharp the X classes have nearly the same interface as in the GDI+ build, but are based internally on Windows Presentation Foundation. [...]

Submitting Issue Reports — 1.3%

[...] as possible. Start with our prepared Issue Submission Templates We have created one solution for PDFsharp and one solution for MigraDoc. Basically these are our Hello World samples. You can use them as a template to build your sample that allows us to replicate the issue you have found. Download the PDFsharp Issue Submission Template . Download the MigraDoc Issue Submission Template . To get you started These solutions basically contain the PDFsharp Hello World sample or the MigraDoc Hello World sample [...]

MigraDoc: Images from Memory — 1.2%

[...] So what can you do if you want to use images from application resources, databases, or streams? With PDFsharp 1.50 beta 2, a new feature was added: MigraDoc now accepts filenames that contain BASE64-encoded images with the prefix "base64:". In this case, the filename does not refer to a file, the filename contains all the bits of the bitmap in an ASCII string with the BASE64 encoding. So the filename can be very long, depending on the size of the file. A byte array (byte[] in C#) can easily be converted to a filename. If you have a stream, [...]

PDFsharp Sample: Export Images — 1.2%

[...] export JPEG images from a PDF file. Note: This snippet shows how to export JPEG images from a PDF file. PDFsharp cannot convert PDF pages to JPEG files. This sample does not handle non-JPEG images. It does not (yet) handle JPEG images that have been flate-encoded. There are several different formats for non-JPEG images in PDF. Those are not supported by this simple sample and require several hours of coding, but this is left as an exercise to the reader. PDFsharp cannot render PDF pages - not to printers, not to bitmaps, not to JPEG files.

PDFsharp: Known Issues — 1.2%

Known issues Object Streams are a new feature of PDFsharp 1.50. There are no known issues as of PDFsharp 1.50 beta 3b, but if you encounter PDF files that cannot [...]

PDFsharp Sample: Booklet — 1.2%

[...] form.PixelHeight; int inputPages = form.PageCount; int sheets = inputPages / 4; if (sheets * 4 0) vacats -= 1; else { // Set page number (which is one-based) for left side form.PageNumber = allpages + 2 * (1 - idx); box = new XRect(0, 0, width / 2, height); // Draw the page identified by the page number like an image gfx.DrawImage(form, box); } // Set page number (which is one-based) for right side form.PageNumber = 2 * idx - 1; box = new XRect(width / 2, 0, width / 2, height); // Draw the page identified [...]

Object Streams — 1.2%

[...] slightly smaller PDF files than the traditional compression method, which zips large data streams only. PDFsharp 1.50 beta is able to read many files that contain IRefStreams. Some files still throw exceptions, but we are working on it. PDFsharp 1.50 does not create Object Streams when saving files. Therefore [...]

MigraDoc: Frequently Asked Questions — 1.2%

Questions and answers about MigraDoc. See also: PDFsharp FAQ About See the MigraDoc Overview for general information about MigraDoc. What is MigraDoc? MigraDoc is the .NET library for modeling and rendering documents. See the MigraDoc Overview for general information about MigraDoc. Can MigraDoc run on Web Servers under Medium Trust? Beginning with version 1.50, PDFsharp/MigraDoc should work under Medium Trust. But since Medium Trust prevents access to the fonts installed with the operating [...]

PDFsharp Sample: HelloWorld — 1.2%

[...] code needed to create the PDF file: using System; using System.Diagnostics; using System.IO; using PdfSharp; using PdfSharp.Drawing; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; namespace HelloWorld { /// /// This sample is the obligatory Hello World program. /// class Program { [...]



Visit the new Website for PDFsharp & MigraDoc Foundation 6.0 for .NET 6 and find information about the new version for Windows, Linux, and other platforms.



Miscellaneous
Home
PDFsharp
FAQ
Samples
Articles
MigraDoc
FAQ
Samples
Articles

ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.

Impressum - Privacy Policy, Data Protection Declaration, Legal Notice