PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simply create arrays

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
gloups



Joined: 24 Jan 2009
Posts: 1

PostPosted: Sat Jan 24, 2009 3:01 pm    Post subject: Simply create arrays Reply with quote

Hello,

I'm currently using PdfSharp in order to create a bill generator for a software. However, I don't found how to display an array.
Could somebody give me a short sample code ?

I've tried this:

Code:

PdfArray array = new PdfArray(document);
try
{
    array.Elements.Add(new PdfString("Article"));
    array.Elements.Add(new PdfString("Prix"));
}
catch (ArgumentException e)
{
    System.Console.WriteLine(e.Message);
}


But id does not work.

Thank you very much by advance.
Back to top
View user's profile Send private message
Soldier-B



Joined: 14 Oct 2008
Posts: 16
Location: USA

PostPosted: Mon Jan 26, 2009 3:01 pm    Post subject: Reply with quote

The PdfArray class is used to represent data stored in an array (in a pdf document) based on the pdf spec, not as a normal data structure. So when I look at the code sample you provided this is what I see:

Code:

// create a new "pdfarray" in "document"
PdfArray array = new PdfArray(document);
try
{
    // add 2 new string elements to "array"
    array.Elements.Add(new PdfString("Article"));
    array.Elements.Add(new PdfString("Prix"));
}
catch (ArgumentException e)
{
    System.Console.WriteLine(e.Message);
}


Here's a link to the PDFsharp sample page for the "Hello World" sample: http://pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=15&Itemid=29
It shows how to output text to a pdf document. Also you might want to take a look at the MigraDoc library too, it may suite your needs better.
Link to MigraDoc + PDFsharp sample: http://pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=55&Itemid=63
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com