Welcome
Guest
•
Login
PDFsharp and MigraDoc Wiki
Navigation
¶
Main Page
Random Page
Create a new Page
All Pages
Categories
Navigation Paths
File Management
Create Account
Quick Search
»
Back
MigraDoc Sample: Images
Modified on 2015/09/14 10:16
by
Thomas Hövel
Categorized as
MigraDoc Samples
,
Samples
{s:navigationPrevUpNext|DocumentViewer-sample|MigraDocSamples|Invoice-sample} This sample shows how to use images in MigraDoc documents. ==PDF Output File== See the PDF file created by this sample: {s:PdfLink|Images-sample%2fImages_output.pdf|output.pdf} (19 kB) ==Screen Shots== Here is a sample screen shot: {s:ImageThumbLink|Hello World with image|Images-sample%2fImagesth.png|Images-sample%2fImages.png} ==Source Code== This snippet shows how to add an image to a MigraDoc document: {s:beginCsharp} /// <summary> /// Creates an absolutely minimalistic document. /// </summary> 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; } {s:endCsharp} {s:sampleSourceCode}
Meta Keywords:
Meta Description:
Change Comment:
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