PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Apr 23, 2024 8:35 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Nov 29, 2006 6:17 pm 
Offline

Joined: Wed Nov 29, 2006 6:05 pm
Posts: 1
In the HelloMigraDoc there is an example that shows how to add "Paragraph", "Chart", "Image" and "Table".

The method MigraDoc.DocumentObjectModel.Section.Add works with "Paragraphs", "Charts", "Images","Tables" and "TextFrames".

I´m trying to add a barcode and a single line in a section.
Is it possible?
How can i do this?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 30, 2006 8:01 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
Hello,

"Paragraphs", "Charts", "Images","Tables" and "TextFrames" are so called 'document elements' and are added to sections. Formatted text and Barcodes are 'paragraph elements' and can be added to paragraphs and cells of a table.
To add barcode and a single line, you must first add a paragraph.

Regards
Stefan Lange


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 27, 2007 3:28 pm 
Offline

Joined: Fri Jul 20, 2007 8:41 pm
Posts: 5
I've run into a problem with Barcodes and so far looking over the code I haven't been able to find the solution. When I add a Barcode to a table cell, the barcode is rendered at 0,0 (top right corner of the document)

I've tried to see how the position is set for other elements when added to a cell but haven't found anything. Can anyone point me to the section of code where the position of a Cell's child elements is set?

Thanks for any help.
-Steve


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 27, 2007 7:11 pm 
Offline

Joined: Fri Jul 20, 2007 8:41 pm
Posts: 5
I have a solution (well, i think it's a solution) for the barcode not rendering in the cell.

If you change this line:
Code:
//gfx.DrawBarCode(bc, xb, new XPoint(barcode.Left.Position, barcode.Top.Position));


To this:
Code:
gfx.DrawBarCode(bc, xb, new XPoint(this.renderInfo.LayoutInfo.ContentArea.X, this.renderInfo.LayoutInfo.ContentArea.Y));


it will render in the *almost* correct position. I need to take the padding into account, still have some more work to do.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 195 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