PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2024 7:34 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Feb 01, 2012 3:56 pm 
Offline

Joined: Wed Feb 01, 2012 3:45 pm
Posts: 1
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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 02, 2012 9:16 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
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;

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group