PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Sep 24, 2020 5:26 am

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: Mon May 25, 2020 4:14 pm 
Offline

Joined: Mon May 18, 2020 6:44 am
Posts: 11
I want one textframe to be on the left and one to be on the right at even lengths.

My code:

Code:
public void DefineInvoice(Document document,List<TicketView1> SampleTickets)
        {
            Section section = document.AddSection();

            // create the text frame for address
            TextFrame addressFrame = section.AddTextFrame();
            addressFrame.Height = "3.0cm";
            addressFrame.Width = "7.0cm";
            addressFrame.Left = ShapePosition.Left;
            //addressFrame.RelativeHorizontal = RelativeHorizontal.Margin;
            //addressFrame.MarginTop = "3.0cm";
            //addressFrame.RelativeVertical = RelativeVertical.Page;

            TextFrame invoiceFrame = section.AddTextFrame();
            invoiceFrame.Height = "3.0cm";
            invoiceFrame.Width = "7.0cm";
            invoiceFrame.Left = ShapePosition.Right;



            //fill in address for text frame
            Paragraph paragraph = addressFrame.AddParagraph();
            paragraph.AddText("Nieto LLC");
            paragraph.AddLineBreak();
            paragraph.AddText("6110 Google Drive");
            paragraph.AddLineBreak();
            paragraph.AddText("Houston, TX 77309");
            paragraph.AddLineBreak();
            paragraph.AddText("P: 281-890-5899");

            paragraph = invoiceFrame.AddParagraph();
            paragraph.AddText("INVOICE NO");


Attachments:
File comment: invoice
Screenshot (4).png
Screenshot (4).png [ 208.82 KiB | Viewed 363 times ]
Top
 Profile  
Reply with quote  
PostPosted: Mon May 25, 2020 6:16 pm 
Offline

Joined: Mon May 18, 2020 6:44 am
Posts: 11
I found that using this code works:

Code:
TextFrame invoiceFrame = section.AddTextFrame();
            invoiceFrame.Height = "3.0cm";
            invoiceFrame.Width = "5.0cm";
            invoiceFrame.Left = ShapePosition.Right;
            invoiceFrame.MarginTop = "-3.0cm";


Is there a better way?


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 13 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