Welcome GuestLogin

PDFsharp and MigraDoc Wiki

RSS RSS

Navigation




Quick Search
»

PoweredBy
<< Previous^UpNext >>
This sample shows how to use images in MigraDoc documents.

PDF Output File

See the PDF file created by this sample: output.pdf (19 kB)

Screen Shots

Here is a sample screen shot:

Hello World with image

Source Code

This snippet shows how to add an image to a MigraDoc document:
/// 
/// Creates an absolutely minimalistic document.
/// 
static Document CreateDocument()
{
  // Create a new MigraDoc document
  Document document = new Document();
 
  // Add a section to the document
  Section section = document.AddSection();
 
  // Add a paragraph to the section
  Paragraph paragraph = section.AddParagraph();
 
  // Add some text to the paragraph
  paragraph.AddFormattedText("Hello, World!", TextFormat.Italic);
  section.AddImage("../../SomeImage.png");
 
  return document;
}

Note: The samples on this site usually show and discuss code snippets only. The complete source code of the samples with solutions for Visual Studio is available from the download area on CodePlex.


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 - Legal Notice