PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 12:19 pm

All times are UTC


Search found 48 matches
Search term used: AddSection Search these results:

Author Message

 Forum: Bug Reports   Topic: Table with merged rows does not grow with text or image

Posted: Wed Jun 05, 2024 11:41 am 

Replies: 4
Views: 2772


... Udklip.PNG Here is some sample code public void Test2() { Document document = new Document(); Section section = document.AddSection(); Table table = new Table(); table.Borders.Width = 0.75; table.AddColumn("1cm"); table.AddColumn("2cm"); table.AddColumn("8cm"); ...

 Forum: Bug Reports   Topic: Table with merged rows does not grow with text or image

Posted: Wed May 29, 2024 3:25 pm 

Replies: 4
Views: 2772


Here is some sample code public void Test2() { Document document = new Document(); Section section = document.AddSection(); Table table = new Table(); table.Borders.Width = 0.75; table.AddColumn("1cm"); table.AddColumn("2cm"); table.AddColumn("8cm"); ...

 Forum: Support   Topic: Embedded table

 Post subject: Re: Embedded table
Posted: Tue Apr 30, 2024 9:11 am 

Replies: 4
Views: 29784


... ??= new FontResolver(); var mainDocument = new Document(); var countryDataDocument = new Document(); var countryDataSection = countryDataDocument.AddSection(); DefineStyles(countryDataDocument); SetUpPage(countryDataSection); AddHeader(countryDataSection); AddFooter(countryDataSection); CreateCountryData(countryDataSection); ...

 Forum: Support   Topic: PDFSharp and Migradoc

 Post subject: PDFSharp and Migradoc
Posted: Fri Apr 12, 2024 1:55 pm 

Replies: 4
Views: 13397


... ' You always need a MigraDoc document for rendering. Dim doc As New MigraDoc.DocumentObjectModel.Document Dim sec As Section = doc.AddSection() ' Add a single paragraph with some text and format information. Dim para As Paragraph = sec.AddParagraph() para.Format.Alignment = ParagraphAlignment.Justify ...

 Forum: Support   Topic: PDF sharp Code

 Post subject: PDF sharp Code
Posted: Mon Jan 22, 2024 9:09 am 

Replies: 1
Views: 12943


... = txtIdentityNo.Text; // Create a new document Document document = new Document(); // Add sections to the document Section section = document.AddSection(); // Add a header to the section HeaderFooter header = section.Headers.Primary; Paragraph headerParagraph = header.AddParagraph(); headerParagraph.AddText("FIXED ...

 Forum: Support   Topic: Adding short or long text as new set of pages to PDF

Posted: Tue Jun 27, 2023 7:16 pm 

Replies: 5
Views: 4241


... is the best choice as it will span the pages automatically, however I'm not sure about the header thing for each page. Am I able to use MigraDoc AddSection and AddParagraph for the automatic pagination in conjunction with a header on each automatically generated page? And will I have any issues ...

 Forum: Support   Topic: RenderDocument generates Index out of range error

Posted: Wed Feb 22, 2023 12:10 am 

Replies: 2
Views: 2848


... style.Font.Name = "Verdana"; style.Font.Size = 10; // Each MigraDoc document needs at least one section. Section section = document.AddSection(); // Create footer Paragraph paragraph = section.Footers.Primary.AddParagraph(); paragraph.AddText("www.greenthumbhub.com - Directory.pdf ...

 Forum: Support   Topic: Gray background on page

 Post subject: Gray background on page
Posted: Mon Feb 20, 2023 1:31 am 

Replies: 3
Views: 3142


... style.Font.Name = "Verdana"; style.Font.Size = 10; // Each MigraDoc document needs at least one section. Section section = document.AddSection(); // Put a logo in the header MigraDoc.DocumentObjectModel.Shapes.Image image = section.Headers.Primary.AddImage("/Images/header.jpg"); ...

 Forum: Support   Topic: Convert PDFSharp PdfDocument to MigraDoc Document

Posted: Mon Feb 13, 2023 7:37 pm 

Replies: 8
Views: 5491


... object PdfPage PageObject = PDFDocObject.Pages[x - 1]; //Create a section in the Document object for each page Section DocSection = DocObject.AddSection(); //Here is the trick to the whole thing. It turns out that you can add //a page from a pdf file as an image to a Document object. Just ...

 Forum: Support   Topic: RenderDocument() error in Azure

Posted: Sun Dec 01, 2019 8:00 pm 

Replies: 6
Views: 9068


... TabAlignment.Right); } private void CreatePage() { //Each MigraDoc document needs at least one section. Section section = this.document.AddSection(); // Create footer Paragraph paragraph = section.Footers.Primary.AddParagraph(); paragraph.AddText("test"); paragraph.Format.Font.Size ...

 Forum: Support   Topic: RTF Document and Images from memory

Posted: Tue May 28, 2019 4:11 pm 

Replies: 4
Views: 8750


... For each image, the following takes place: lcImage = "base64:" + System.Convert:ToBase64String(ObjectBytes). oSection = oDocument:AddSection(). oSection:AddImage(lcImage). After loop above completes for each image... oRender = NEW MigraDoc.RtfRendering.RtfDocumentRenderer(). oRender:Render(oDocument, ...

 Forum: Support   Topic: Text box sizes in document

Posted: Wed Aug 23, 2017 3:02 pm 

Replies: 5
Views: 9711


... migradoc. I have a some questions about position elements on doc. First i add section to a4 page without margins Section section = this.document.AddSection(); section.PageSetup.LeftMargin = "0pt"; section.PageSetup.TopMargin = "0pt"; section.PageSetup.PageHeight = "755pt"; ...

 Forum: Support   Topic: Migradoc - Insert TOC in the beginning of document

Posted: Mon Jun 26, 2017 3:23 pm 

Replies: 3
Views: 5381


A call to "AddSection()" returns the new section. Store this result in a variable/member for future use.

You can use the "Sections" property of the "Document" class to access any section of the document at any time.

 Forum: Support   Topic: Migradoc - Insert TOC in the beginning of document

Posted: Sun Jun 25, 2017 10:30 pm 

Replies: 3
Views: 5381


... GFI api. To make the TOC using the bookmarks, how can I prepend the TOC page in the beginning of the document. It seems like Migradoc only has the AddSection() function which adds the page to the end of the document. I tried to create the TOC section in the beginning of the document and leave it ...

 Forum: Support   Topic: Preview - different page sizes

Posted: Fri Mar 24, 2017 10:37 am 

Replies: 1
Views: 5931


... But in the documentviewer preview both pages have the same size (section1). public static void Test(Document document) { var section1 = document.AddSection(); section1.PageSetup = document.DefaultPageSetup.Clone(); section1.PageSetup.PageHeight = "297mm"; section1.PageSetup.PageWidth ...

 Forum: Support   Topic: How to show an image from SQL Database on PDF?

Posted: Wed Mar 01, 2017 1:58 pm 

Replies: 5
Views: 8761


... That depends. PDFsharp: Search for "AddPage", and maybe also "pagebreak". MigraDoc: Search for "AddPagebreak", "AddSection", and maybe also "pagebreak". I think it cannot harm to start a new thread if the question does not relate to any code shown ...

 Forum: Bug Reports   Topic: RTF renderer doesn't resize images properly [Fixed?]

Posted: Wed Jan 18, 2017 1:32 pm 

Replies: 4
Views: 14884


... class Program { static void Main(string[] args) { Document document = new Document(); // Add a section to the document Section section = document.AddSection(); // Add a paragraph to the section Paragraph paragraph = section.AddParagraph(); // Add some text to the paragraph var image = section.AddImage(@"C:\template_figure.png"); ...

 Forum: Support   Topic: Text file to pdf error

 Post subject: Re: Text file to pdf error
Posted: Wed Aug 10, 2016 12:49 pm 

Replies: 7
Views: 9691


... generating however the text formatting is lost and the margins are also big. Code: Document document = new Document(); Section section = document.AddSection(); section.PageSetup = document.DefaultPageSetup.Clone(); //section.PageSetup.PageWidth = "42cm" 'A3 //section.PageSetup.PageHeight ...

 Forum: Support   Topic: Text file to pdf error

 Post subject: Re: Text file to pdf error
Posted: Mon Aug 08, 2016 7:25 pm 

Replies: 7
Views: 9691


... String theText = File.ReadAllText("C:\Viacom\txtToPdf\DAY_6.txt") 'C part Document document = new Document(); Section section = document.AddSection(); section.PageSetup = document.DefaultPageSetup.Clone(); section.PageSetup.PageWidth = "32cm"; section.PageSetup.PageHeight = ...

 Forum: Support   Topic: Rendering hyperlink error - Value of 0 is not valid emsize

Posted: Mon Dec 29, 2014 7:38 pm 

Replies: 1
Views: 4237


... gfx1 = XGraphics.FromPdfPage(page1); Document document = new Document(); var renderer = new DocumentRenderer(document); Section section = document.AddSection(); Paragaragh para = section.AddParagraph(); var link = para.AddHyperlink(@"http://www.google.com/", HyperlinkType.Web); link.AddText("Click ...

 Forum: Support   Topic: Japanese chars

 Post subject: Japanese chars
Posted: Thu Nov 27, 2014 5:31 pm 

Replies: 0
Views: 7169


... I cannot attach PDFF themselves. but good one has 69kB bad one 12kB Document document = new Document(); //141127 Section section = document.AddSection(); Paragraph paragraph = section.AddParagraph(); document.Styles[StyleNames.Normal].Font.Name = "Arial Unicode MS"; paragraph.AddFormattedText("GenerateIDIReport: ...

 Forum: Support   Topic: How to Remove a paragraph / table from a migradoc document?

Posted: Wed Aug 27, 2014 8:55 am 

Replies: 3
Views: 6461


... the question this way to make things simpler. Say we have the following code: var pdfdocument = new Document(); var pdfsection = pdfdocument.AddSection(); var para1 = pdfsection.AddParagraph(); var para2 = pdfsection.AddParagraph(); var para3 = pdfsection.AddParagraph(); // para2.Remove() ...

 Forum: Support   Topic: how to calculate the height of my header

Posted: Fri Feb 28, 2014 9:54 am 

Replies: 1
Views: 4383


... on the height of header how can i do that? i can not fix the area for header and image //HEADER Document doc = new Document(); Section sec = doc.AddSection(); // Add a single paragraph with some text and format information. Paragraph para = sec.AddParagraph(); para.AddText(htmlHeader); //IMAGE ...

 Forum: Support   Topic: How to Add Image and Text in the same line using MigraDoc

Posted: Wed Mar 20, 2013 1:14 pm 

Replies: 5
Views: 22122


... in same row. I also tried the same using the Table. But again it was negative. I am using the below code... Section section = this.document.AddSection(); // Put a logo in the header MigraDoc.DocumentObjectModel.Shapes.Image image = section.Headers.Primary.AddImage("../../ABCD.png"); ...

 Forum: Support   Topic: Heading information in the header and footer

Posted: Fri Jan 11, 2013 6:30 am 

Replies: 7
Views: 10243


... specific text for header and footer for this section. My code looks like this: foreach(Chapter chpt in newPageChapterList) { Section section = doc.AddSection(); definePageSetup(section); defineHeaderAndFooter(section, chpt.Title); } and within "defineHeaderAndFooter" (I did it for header, ...

 Forum: Support   Topic: Draw shapes

 Post subject: Re: Draw shapes
Posted: Tue Sep 04, 2012 6:12 am 

Replies: 1
Views: 8970


... understand I will give an example with rectangle: Document document = new Document(); MigraDoc.DocumentObjectModel.Section section = document.AddSection(); TextFrame textFrame = new TextFrame(); textFrame.Width = new Unit(200); textFrame.Height = new Unit(200); textFrame.RelativeHorizontal ...

 Forum: Support   Topic: Absolute Newbie Needing Basic Help

Posted: Thu Jun 21, 2012 8:19 am 

Replies: 1
Views: 5219


Hi! You should call something like "row = table.AddRow()" before setting the paragraph in the row. You also need "table = document.AddSection.AddTable()". Your code creates a table without any rows and without any columns in the section (therefore you see nothing). You also ...

 Forum: Support   Topic: Vertical text in MigraDoc table

Posted: Wed Apr 25, 2012 11:47 am 

Replies: 2
Views: 17513


... Thanks a lot for any help :-) public void DummyReport(string reportFilename) { Document document = new Document(); Section section = document.AddSection(); Table dataTbl = section.AddTable(); dataTbl.Borders.Color = TableBorder; // Two columns - the first vertical, the next horisontal Column ...

 Forum: Support   Topic: Is section a page in Migradoc?

Posted: Thu Nov 10, 2011 10:26 am 

Replies: 3
Views: 15588


... for all the pages? So, I have defined headers and footers like this: static void DefineContent(Document document) { Section section = document.AddSection(); section.PageSetup.HeaderDistance = "0.2cm"; section.PageSetup.StartingNumber = 1; HeaderFooter header = section.Headers.Primary; ...

 Forum: Support   Topic: NewLine-Seperator does not work

Posted: Tue Apr 19, 2011 5:32 pm 

Replies: 2
Views: 7624


... I have code like this in VB.Net: Dim doc As New MigraDoc.DocumentObjectModel.Document Dim sec As MigraDoc.DocumentObjectModel.Section = doc.AddSection Dim para As MigraDoc.DocumentObjectModel.Paragraph = sec.AddParagraph("Test \n Test") Dim Render As MigraDoc.Rendering.PdfDocumentRenderer ...

 Forum: Support   Topic: Text that goes over a page

 Post subject: Text that goes over a page
Posted: Fri Feb 25, 2011 3:59 pm 

Replies: 1
Views: 3402


... = PageOrientation.Portrait; page.Size = PageSize.A4; XGraphics gfx = XGraphics.FromPdfPage(page); Document doc = new Document(); Section sec = doc.AddSection(); // Add a single paragraph with some text and format information. Paragraph para = sec.AddParagraph(); then create a paragraph to include ...

 Forum: Support   Topic: barcode font in PDF used on 1 machine but not the other?

Posted: Tue Jan 25, 2011 2:22 pm 

Replies: 9
Views: 13164


... Dim doc As New MigraDoc.DocumentObjectModel.Document Dim section As MigraDoc.DocumentObjectModel.Section = doc.AddSection() doc.LastSection.Add(tbl) Dim docRenderer As MigraDoc.Rendering.DocumentRenderer = New MigraDoc.Rendering.DocumentRenderer(doc) docRenderer.PrepareDocument() ...

 Forum: Support   Topic: Dynamic sections & tables

Posted: Tue Nov 23, 2010 8:40 am 

Replies: 1
Views: 3199


For every new date, you call AddSection to create a new section (sections always start on a new page). Then add the date-specific information and the table. New pages will be added automatically if the table doesn't fit on a single page. ...

 Forum: Support   Topic: emSize cannot be 0

 Post subject: Re: emSize cannot be 0
Posted: Fri Oct 08, 2010 4:12 pm 

Replies: 6
Views: 8580


... PdfFontEncoding.Unicode; gfx.MFEH = PdfFontEmbedding.Default; // You always need a MigraDoc document for rendering. myMigraDocPage = myMigradocDoc.AddSection(); //...Later I perform the following bound with the new doc/page created above. myMigradocDoc = myMigraDocPage.Document; docRenderer = new ...

 Forum: Support   Topic: Auto Paging

 Post subject: Auto Paging
Posted: Wed Jun 02, 2010 4:25 pm 

Replies: 1
Views: 4843


... page and that is all. here is the code //this Document is from the MigraDoc.DocumentObjectModel Document doc = new Document(); Section sec = doc.AddSection(); Paragraph terms = sec.AddParagraph(); terms.Format.Font.Name = "Calibri"; terms.Format.Font.Size = "11"; terms.Format.Font.Color ...

 Forum: Support   Topic: Rendering a Migradoc for Streaming

Posted: Wed Mar 24, 2010 3:37 pm 

Replies: 3
Views: 6259


... first proper page of my document and keeps a plain page at the start. So it seems MigraDoc creates an empty page (maybe caused by AddPageBreak or AddSection or ...). With start value 2 you remove this page. Maybe you have an AddPage before the loop and one inside your loop. That's the page you ...

 Forum: Support   Topic: MigraDoc nested tables overlapping

Posted: Fri Aug 28, 2009 11:39 am 

Replies: 2
Views: 11775


... Below is the code for getting the described behavior. Thanks for your quick answers. Best Regards, Sofoklis Document doc = new Document(); doc.AddSection(); Table layoutTable = new Table(); layoutTable.AddColumn(200); layoutTable.AddColumn(200); TextFrame tf; layoutTable.AddRow(); Table innerTable ...

 Forum: Support   Topic: MigraDoc nested tables overlapping

Posted: Mon Aug 24, 2009 7:28 pm 

Replies: 2
Views: 11775


... of the rows where the TextFrame is gets totaly wrong and you get overlapping tables. Code to replicate this: Document doc = new Document(); doc.AddSection(); Table layoutTable = new Table(); layoutTable.AddColumn(200); layoutTable.AddRow(); Table innerTable = layoutTable[0, 0].AddTextFrame().AddTable(); ...

 Forum: Support   Topic: Height

 Post subject: Height
Posted: Tue Jun 09, 2009 4:55 am 

Replies: 2
Views: 4961


... XStringFormats.Center) Dim font3 As New XFont("Book Antiqua", 11, XFontStyle.Regular) Dim doc As New Document Dim sec As Section = doc.AddSection() Dim table As Table = sec.AddTable() table.Borders.Visible = False table.Columns.Width = "6.93cm" table.TopPadding = 3 Dim column ...

 Forum: Support   Topic: Trouble generating PDF file with table

Posted: Mon May 18, 2009 8:27 am 

Replies: 7
Views: 11399


You don't have to call AddPage if you use MigraDoc. Change the PageSetup of your section after calling AddSection and all pages in this section will be Landscape. Or change this loop "For i As Integer = 0 To render.FormattedDocument.PageCount - 1" to set Landscape ...

 Forum: Support   Topic: multi-page pdf and new browser window - help!

Posted: Tue Feb 03, 2009 9:24 am 

Replies: 4
Views: 10115


... have to go this way if you want to improve the pages created by MigraDoc with some PDFsharp calls. I thought that's what you need. You can call AddSection in a loop from 1 through 10,000 and see how many pages MigraDoc will create. If you add nine manual page breaks you'll get at least 10 pages. ...

 Forum: Support   Topic: multi-page pdf and new browser window - help!

Posted: Tue Feb 03, 2009 6:57 am 

Replies: 4
Views: 10115


... // code snippet #2 // You need always a MigraDoc document for rendering. Document doc = new Document(); Section sec = doc.AddSection(); // Add a single paragraph with some text and format information. Paragraph para = sec.AddParagraph(); This still renders the document ...

 Forum: Support   Topic: Footer formatting for PageOrientation.Landscape

Posted: Tue Nov 25, 2008 5:44 pm 

Replies: 1
Views: 4362


I defined new MigraDoc document m_Doc and added section: Section sec = m_Doc.AddSection(); Then I created the footer and appropriate paragraph: HeaderFooter footer = sec.Footers.Primary; Paragraph footerPara = new Paragraph(); Then I defined paragraph format: ...

 Forum: Bug Reports   Topic: PrepareDocument hangs with small section

Posted: Thu Oct 16, 2008 2:13 pm 

Replies: 0
Views: 5078


... MigraDoc 1.2.2546.0; Visual Studio 2008 SP1; Windows Vista 32-bit; 1. Open the GDI+ MixMigraDocAndPdfSharp project; 2. After line 88 (doc.AddSection), add the following: sec.PageSetup.PageWidth = Unit.FromCentimeter(12); sec.PageSetup.PageHeight = Unit.FromCentimeter(1); ...

 Forum: Support   Topic: Migra Doc table image

Posted: Tue Sep 02, 2008 8:35 am 

Replies: 7
Views: 11094


... stuck as to how to implement this in migradoc,as i just started using this pdf tool Document document = new Document(); Section section = document.AddSection(); section.AddImage("test.gif"); Table table = new Table(); Column column = table.AddColumn(Unit.FromInch(7)); Cell cell; Row row ...

 Forum: Support   Topic: RenderDocument Too sLow

 Post subject: RenderDocument Too sLow
Posted: Sun May 04, 2008 7:51 pm 

Replies: 1
Views: 6102


... document.Info.Subject = "MySubject"; document.Info.Author = "MyAuthor"; Section section = document.Sections.AddSection(); Table table = new Table(); table.Borders.Width = 0.75; table.Format.Font.Size = 8; Column column; for (Int32 i = 0; i < Headers.Length;i++ ...

 Forum: Support   Topic: Specified argument was out of the range of valid values?

Posted: Thu Jul 19, 2007 4:16 pm 

Replies: 4
Views: 14194


... document.Info.Author = "Antony Lau"; //You should create at least one section for each MigraDoc document. Section section = document.AddSection(); //Add a table to this section. table = section.AddTable(); table.Borders.Color = new Color(81, 125, 192); Column column; //You must define ...

 Forum: Support   Topic: Specified argument was out of the range of valid values?

Posted: Thu Jul 19, 2007 3:15 pm 

Replies: 4
Views: 14194


... pdfRender.RenderDocument(); gives me the following error message. I don't know why. Well, I basically did this: Section section = this.document.AddSection(); this.table = section.AddTable(); And then created 3 columns and 2 rows for the table. Then I set the table edge, and then I try to render ...
Sort by:  
Page 1 of 1 [ Search found 48 matches ]


All times are UTC


Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group