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 DDL (MDDDL)
Modified on 2010/01/19 11:16
by
Thomas Hövel
Categorized as
Articles
,
MigraDoc Articles
MigraDoc DDL, the MigraDoc Document Description Language (MDDDL), is a text based serialization of a MigraDoc document. It is used to pass a document to the {s:className|DocumentPreview} class. It can also be used to persist a document in a file (using the {s:className|DdlWriter} and {s:className|DdlReader} classes). Such a DDL file can also be helpful if a document doesn't quite look as expected. Here's a code snippet that shows how to save a MDDDL file in Debug build only: {s:beginCsharp} <nowiki>#if DEBUG MigraDoc.DocumentObjectModel.IO.DdlWriter dw = new MigraDoc.DocumentObjectModel.IO.DdlWriter("HelloWorld.mdddl"); dw.WriteDocument(document); dw.Close(); #endif</nowiki>{s:endCsharp} And here's a MigraDoc DDL snippet from the [MigraDocHelloWorld-sample|Hello World sample]: {s:beginCsharp} \section [ PageSetup { PageHeight = "29.7cm" PageWidth = "21cm" Orientation = Portrait LeftMargin = "2.5cm" RightMargin = "2.5cm" TopMargin = "2.5cm" BottomMargin = "2cm" FooterDistance = "1.25cm" HeaderDistance = "1.25cm" OddAndEvenPagesHeaderFooter = false DifferentFirstPageHeaderFooter = false SectionStart = BreakNextPage PageFormat = A4 MirrorMargins = false HorizontalPageBreak = false } ] { \paragraph [ Style = "Normal" Format { Font { Name = "Verdana" Size = 10 Bold = false Italic = false Underline = None Superscript = false Color = CMYK(100,30,20,50) } Alignment = Left LeftIndent = 0 FirstLineIndent = 0 RightIndent = 0 SpaceBefore = 0 SpaceAfter = 0 LineSpacingRule = Single LineSpacing = 10 KeepTogether = false KeepWithNext = false WidowControl = true PageBreakBefore = false OutlineLevel = BodyText } ] { \font [Name = "Verdana" Size = 10 Bold = true Italic = false Underline = None Superscript = false Color = CMYK(100,30,20,50) ] {Hello, World!} } } {s:endCsharp} {s:separator} <small>Personal comment by Stefan Lange: We at empira Software invented MDDDL in 2000/2001, approximately at the same time when Microsoft invented XAML (original acronym for eXtensible Avalon Markup Language). Today I have used XAML with WPF and Silverlight for more than 3 years. But when I take a look at MDDDL, I still find it ''significantly'' more readable.<small>
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