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 

Incorporate PDFSharp with MigraDoc

 
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
neto_pf



Joined: 22 May 2007
Posts: 2

PostPosted: Tue May 22, 2007 3:26 pm    Post subject: Incorporate PDFSharp with MigraDoc Reply with quote

I'm new in PDFSharp and I don't know how to insert a table in a existing pdf file which is in my disk.
In PDFSharp it's easy to do it, but in MigraDoc it isn't (or I don't saw anything), could someone help me with this problem.
I want to edit an exiting pdf file and put there one table, or could I put a MigraDoc Document inside a PDFDocument or vice versa?
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Tue May 22, 2007 3:38 pm    Post subject: Reply with quote

You can use MigraDoc to create a new PDF file with the table, then use PDFsharp to add pages from that PDF file to your "old" PDF file.

Adding new pages is quite simple and several PDFsharp samples show the trick.

I hope this helps...
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
neto_pf



Joined: 22 May 2007
Posts: 2

PostPosted: Thu May 24, 2007 8:49 am    Post subject: Incorporate PDFSharp with MigraDoc Reply with quote

Thank you Thomas for your help, but like I said I'm new in PDFSharp, thats why I will put another post, How do I add a Document in MigraDoc to PDFDocument in PDFSharp? This is my code:

Table table = new Table();
table.Borders.Width = 0.75;

Column column = table.AddColumn(Unit.FromCentimeter(2));
column.Format.Alignment = ParagraphAlignment.Center;

column = table.AddColumn(Unit.FromCentimeter(5));

Cell cell;
Row row = table.AddRow();
row.Shading.Color = Colors.PaleGoldenrod;
cell = row.Cells[0];
cell.AddParagraph("Itemus");
cell = row.Cells[1];
cell.AddParagraph("Descriptum");

row = table.AddRow();
cell = row.Cells[0];
cell.AddParagraph("1");
cell = row.Cells[1];
cell.AddParagraph(BlindText.ShortText);

row = table.AddRow();
cell = row.Cells[0];
cell.AddParagraph("2");
cell = row.Cells[1];
cell.AddParagraph(BlindText.Text);

table.SetEdge(0, 0, 2, 3, Edge.Box, BorderStyle.Single, 1.5, Colors.Black);

Document docTable = new Document();
docTable.LastSection.Add(table);


PdfDocument docPDF = PdfSharp.Pdf.IO.PdfReader.Open("c:\\test.pdf");
//this will not work, right?
docPDF.Pages.Add(docTable);

Can I add a MigraDoc Table to a XRect through the class XGraphics with the PDF?

Thank you for your help.
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Thu May 24, 2007 9:57 am    Post subject: Re: Incorporate PDFSharp with MigraDoc Reply with quote

neto_pf wrote:
Can I add a MigraDoc Table to a XRect through the class XGraphics with the PDF?

You can use a PdfDocumentRenderer to create a PDF file from your MigraDoc document.
Pages from this newly created PDF file can be used with XGraphics. Samples like TwoPagesOnOne show you how to do this.
A more elegant way may come with future versions. Now you have to live with a temporary PDF file - this should be no performance issue however.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
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