PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 15, 2024 10:31 pm

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: Thu Apr 26, 2012 11:02 am 
Offline

Joined: Wed Apr 25, 2012 9:30 am
Posts: 6
I'm trying to add barcode into a table cell

Code:
                MigraDoc.DocumentObjectModel.Shapes.Barcode bcode = table.Rows[Row - 1][Column - 1].Elements.AddBarcode();
                bcode.Code = "code";
                bcode.Text = true;
                bcode.Type = BarcodeType.Barcode128;


and code
Code:
public void GeneratePreview()
        {
            string str = MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToString(this.StickersDoc);
            this.documentPreview1.Ddl = str;
        }

throws exception on line this.documentPreview1.Ddl = str;

Code:
at MigraDoc.Rendering.TopDownFormatter.FormatOnAreas(XGraphics gfx, Boolean topLevel)
   at MigraDoc.Rendering.FormattedCell.Format(XGraphics gfx)
   at MigraDoc.Rendering.TableRenderer.FormatCells()
   at MigraDoc.Rendering.TableRenderer.InitFormat(Area area, FormatInfo previousFormatInfo)
   at MigraDoc.Rendering.TableRenderer.Format(Area area, FormatInfo previousFormatInfo)
   at MigraDoc.Rendering.TopDownFormatter.FormatOnAreas(XGraphics gfx, Boolean topLevel)
   at MigraDoc.Rendering.FormattedDocument.Format(XGraphics gfx)
   at MigraDoc.Rendering.DocumentRenderer.PrepareDocument()
   at MigraDoc.Rendering.Forms.DocumentPreview.DdlUpdated()
   at MigraDoc.Rendering.Forms.DocumentPreview.set_Ddl(String value)
   at BarCodeGenerator.FormBarcodes.GeneratePreview()
   at BarCodeGenerator.FormBarcodes..ctor(Int32 Column, Int32 Row)
   at BarCodeGeneratorTest.Form1.button1_Click(Object sender, EventArgs e) in D:\komponenty CH\BarCodeGenerator\BarCodeGeneratorTest\Form1.cs:line 27
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
 


If I put text instead of barcodes everything works fine, so the problem is for sure with barcode implementation


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 26, 2012 11:50 am 
Offline

Joined: Wed Apr 25, 2012 9:30 am
Posts: 6
Ok, I realized.
I had to apply patch viewtopic.php?p=3332#p3332


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: Google [Bot] and 39 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