PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

What namespaces are being loaded for migradoc
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1896
Page 1 of 1

Author:  Luke101 [ Wed Feb 01, 2012 3:56 pm ]
Post subject:  What namespaces are being loaded for migradoc

I am using powershell to use migradoc and pdfsharp. I have a problem in figuring out what namespaces are being used in the examples. For example:

Code:
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();
 
  paragraph.Format.Font.Color = Color.FromCmyk(100, 30, 20, 50);
 
  // Add some text to the paragraph
  paragraph.AddFormattedText("Hello, World!", TextFormat.Bold);
 
  return document;
}


This code is posted at this url: http://www.pdfsharp.net/wiki/MigraDocHe ... ample.ashx

But it does not show which namespaces are being used. If I could see the namespaces (using clause) i can figure out how to use the library with powershell. Is it possible that you can direct me on how to find out what namespaces are being used in the examples?

Edit:
Here is I created a document object I created in powershell:
Code:
$document = new-object MigraDoc.DocumentObjectModel.Document


The code above I had to guess the namespace layout and got lucky. So i was able to successfully create a new document (not tested) but cannot figure out the other objects in the examples. When going through the examples how can I know what namesspaces are used.

Author:  Thomas Hoevel [ Thu Feb 02, 2012 9:16 am ]
Post subject:  Re: What namespaces are being loaded for migradoc

The complete source code of all samples is included with PDFsharp (source code ZIP).
We omitted the usings from the Wiki because they distract from the points we want to show.

See also:
viewtopic.php?p=5178#p5178

The usings from the HelloWorld sample:
Code:
using System.Diagnostics;
using MigraDoc.DocumentObjectModel;
using MigraDoc.Rendering;
using PdfSharp.Pdf;
using Color = MigraDoc.DocumentObjectModel.Color;

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/