View previous topic :: View next topic |
Author |
Message |
lucio_tanaka
Joined: 29 Nov 2006 Posts: 1
|
Posted: Wed Nov 29, 2006 6:17 pm Post subject: Migradoc - Adding elements |
|
|
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? |
|
Back to top |
|
 |
Stefan Lange

Joined: 12 Oct 2006 Posts: 47 Location: Cologne, Germany
|
Posted: Thu Nov 30, 2006 8:01 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
sklett
Joined: 20 Jul 2007 Posts: 5
|
Posted: Fri Jul 27, 2007 3:28 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
sklett
Joined: 20 Jul 2007 Posts: 5
|
Posted: Fri Jul 27, 2007 7:11 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
|