PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 8:40 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Sep 23, 2010 9:28 am 
Offline

Joined: Thu Sep 23, 2010 9:20 am
Posts: 2
Hello!
I want to draw a TextFrame with both, a FillFormat and a LineFormat set. Here's my code:
Code:
            Document document = new Document();
            Section sec = document.AddSection();
            TextFrame tf = sec.AddTextFrame();

            tf.FillFormat.Color = Colors.Red;
            tf.FillFormat.Visible = true;

            tf.LineFormat.Color = Colors.Black;
            tf.LineFormat.Width = Unit.FromMillimeter(1d);
            tf.LineFormat.Visible = true;

            PdfDocumentRenderer renderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.Always);
            renderer.Document = document;

            renderer.RenderDocument();

            string filename = "TextFrameFillError.pdf";
            renderer.PdfDocument.Save(filename);
            System.Diagnostics.Process.Start(filename);


The output looks like this (the border is offset from the TextFrame to the top and to the left):
Attachment:
Screenshot.JPG
Screenshot.JPG [ 15.93 KiB | Viewed 7945 times ]

Am I doing something wrong? Please help!
Thanks a lot.


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 23, 2010 12:21 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Xandolph wrote:
Am I doing something wrong?

I guess it's a bug. I'll put it on the list for the next release.

Have you tried both builds (GDI+ and WPF)?
Maybe the error occurs with one of them only.
Which build do you use?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 23, 2010 3:19 pm 
Offline

Joined: Thu Sep 23, 2010 9:20 am
Posts: 2
I use GDI+.
Thanks for your reply.


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

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 57 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