Author |
Message |
Forum: Bug Reports Topic: Table with merged rows does not grow with text or image |
LeFroq |
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"); ... |
|
![](images/spacer.gif) |
Forum: Bug Reports Topic: Table with merged rows does not grow with text or image |
LeFroq |
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"); ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Embedded table |
mark.kelemen0001 |
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); ... |
|
![](images/spacer.gif) |
Forum: Support Topic: PDFSharp and Migradoc |
dtorraco |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: PDF sharp Code |
siyakubeka |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Adding short or long text as new set of pages to PDF |
choco |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: RenderDocument generates Index out of range error |
marty.nord |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Gray background on page |
marty.nord |
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"); ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Convert PDFSharp PdfDocument to MigraDoc Document |
dhaverstick |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: RenderDocument() error in Azure |
Davy |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: RTF Document and Images from memory |
jrk |
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, ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Text box sizes in document |
pistoletov |
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"; ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Migradoc - Insert TOC in the beginning of document |
Thomas Hoevel |
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. |
|
![](images/spacer.gif) |
Forum: Support Topic: Migradoc - Insert TOC in the beginning of document |
Steven |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Preview - different page sizes |
fkMigra |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: How to show an image from SQL Database on PDF? |
Thomas Hoevel |
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 ... |
|
![](images/spacer.gif) |
Forum: Bug Reports Topic: RTF renderer doesn't resize images properly [Fixed?] |
MariusIonut |
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"); ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Text file to pdf error |
jaychabria |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Text file to pdf error |
jaychabria |
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 = ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Rendering hyperlink error - Value of 0 is not valid emsize |
Venkat0110 |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Japanese chars |
gastan |
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: ... |
|
![](images/spacer.gif) |
Forum: Support Topic: How to Remove a paragraph / table from a migradoc document? |
souravsaraf1230 |
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() ... |
|
![](images/spacer.gif) |
Forum: Support Topic: how to calculate the height of my header |
chhavi |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: How to Add Image and Text in the same line using MigraDoc |
er.narendraojha |
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"); ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Heading information in the header and footer |
MakroDoccer |
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, ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Draw shapes |
cmarian |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Absolute Newbie Needing Basic Help |
Thomas Hoevel |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Vertical text in MigraDoc table |
Klitgaard |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Is section a page in Migradoc? |
tulips |
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; ... |
|
![](images/spacer.gif) |
Forum: Support Topic: NewLine-Seperator does not work |
ReinerWolff |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Text that goes over a page |
paulv |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: barcode font in PDF used on 1 machine but not the other? |
petersmith |
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() ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Dynamic sections & tables |
Thomas Hoevel |
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. ... |
|
![](images/spacer.gif) |
Forum: Support Topic: emSize cannot be 0 |
henrylar |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Auto Paging |
Locke12 |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Rendering a Migradoc for Streaming |
Thomas Hoevel |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: MigraDoc nested tables overlapping |
sofoklis24 |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: MigraDoc nested tables overlapping |
sofoklis24 |
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(); ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Height |
tmiller_15 |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Trouble generating PDF file with table |
Thomas Hoevel |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: multi-page pdf and new browser window - help! |
Thomas Hoevel |
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. ... |
|
![](images/spacer.gif) |
Forum: Support Topic: multi-page pdf and new browser window - help! |
pranayjoshi |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Footer formatting for PageOrientation.Landscape |
jbanko |
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: ... |
|
![](images/spacer.gif) |
Forum: Bug Reports Topic: PrepareDocument hangs with small section |
RichardD |
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); ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Migra Doc table image |
mav23 |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: RenderDocument Too sLow |
CarlosMag |
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++ ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Specified argument was out of the range of valid values? |
choreson |
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 ... |
|
![](images/spacer.gif) |
Forum: Support Topic: Specified argument was out of the range of valid values? |
choreson |
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 ... |
|
![](images/spacer.gif) |
Sort by: |