Questions tagged [migradoc]

MigraDoc Foundation is an open source .NET library that easily creates documents based on an object model with paragraphs, tables, styles, etc. and renders them into PDF or RTF. Use this tag for questions related to MigraDoc using any platform and any programming language.

MigraDoc Foundation is an open source .NET library that easily creates documents based on an object model with paragraphs, tables, styles, etc. and renders them into PDF or RTF.

MigraDoc Resources

Questions

Use this tag for all questions that relate to using the MigraDoc library.

PDFsharp is a different library from the same authors. MigraDoc includes PDFsharp and uses PDFsharp to create PDF files. Not all questions about MigraDoc justify the PDFsharp tag.
It is less confusing for people trying to answer your questions when you use the tag that corresponds to the API you are using (either or ). Simply look at the namespace of the objects you are using.

Related Tags

, ,

387 questions
0
votes
1 answer

Image location doesn't work if your page is Landscape in migradoc (pdfsharp)

i have the following code that works fine to put an image in the bottom left of the page (in portrait mode). once i change the page to landscape mode, the image goes off the screen. how would i lay this out in landscape mode so it shows up on the…
leora
  • 188,729
  • 360
  • 878
  • 1,366
0
votes
1 answer

is there a way to add a bookmark that is different than the text in the pdf document

using migradoc, i see how you can add a bookmark automatically by doing this: Paragraph p1 = document.LastSection.AddParagraph("Project Updates", "Heading2"); but what if i want to add a bookmark that says "Updates" but the text in the paragraph…
leora
  • 188,729
  • 360
  • 878
  • 1,366
0
votes
2 answers

Using PDFsharp and MigraDoc only for printing(not creating PDF)

I want to print some formatted text using C#. the text is something like this: Hi i am a Multi-line partially formatted text. I want to be printed using C#(winforms). I might contain some unicode text like مرا به هیچ بدادی و من هنوز بر آنم/ که از…
samad montazeri
  • 1,203
  • 16
  • 28
0
votes
1 answer

PDFsharp MigraDoc set height of element

Is there a way to set fixed height of an element? Could be a table, row or section. This element is dynamically generated from database and it can have a variable number of rows. I need to do that, because the section below needs to be in a fixed…
0
votes
1 answer

PDF Layout with MigraDoc

I am trying to achieve following matrix kind of layout: TABLE1,1 TABLE1,2 CHART2,1 TABLE2,2 TABLE3 --> occupies whole row CHART4 --> ocupies whole row CHART5,1 CHART5,2 ................. List goes on... These components may span over multiple…
0
votes
1 answer

PDF generated on CI server fails Approval Test

I am trying out ApprovalTests.NET to test some (mostly legacy) PDF generation code build on MigraDoc. The code under test renders the PDF to a MemoryStream, which is then scrubbed of various metadata properties (using code I adapted from…
Blisco
  • 601
  • 6
  • 14
0
votes
1 answer

Fonts don't load in the pdf viewer

I have currently a problem with PdfSharp/MigraDoc and a pdf viewer. I have used the EZFontResolver made by Thomas to be able to generate pdfs with custom fonts. Unfortunately the pdf viewer is unable to render the font, and I have no idea why. I…
Michał J. Gąsior
  • 1,457
  • 3
  • 21
  • 39
0
votes
1 answer

Multi page section with title on every page in MigraDoc

I want a document with multiple pages. Every page should have the same header. One section of the document contains a long table, which stretches over multiple pages. On every page of this section I want to show a title above the table. I came up…
Tim Pohlmann
  • 4,140
  • 3
  • 32
  • 61
0
votes
1 answer

Push paragraphs down to not overlap with page header in MigraDoc 1.5b3

The code below aims to add an image and date stamp to the page header and then populate the page with some text (for example one header and a couple of paragraphs). The problem is that the text overlaps the page header, it starts at the same height…
ajeh
  • 2,652
  • 2
  • 34
  • 65
0
votes
2 answers

MigraDoc: Rendering the same document twice

I want to render a "Document"-object twice, but on the second generation the PDF-File shows an error: Error on this page. Maybe this page couldn't appear correctly. Please talk to the document-creator. Sorry, it is german... This is my…
Basssprosse
  • 334
  • 1
  • 3
  • 17
0
votes
1 answer

C# MigraDoc margins incorrect size?

Left and top margins are not 7mm. Why? Document document = new Document(); Section sec = document.AddSection(); sec.PageSetup.PageWidth = Unit.FromMillimeter(210); sec.PageSetup.PageHeight = Unit.FromMillimeter(297); sec.PageSetup.LeftMargin =…
Kraken
  • 39
  • 5
0
votes
1 answer

MigraDOC and pdfSharp, center dynamic text

i was looking for a solution to create a document (PDF) in such why that i can calculate an input field: The PDF content should look something like this (all pdf content needs to be centered) Header Field1 : not dynamic (needs to be…
user6015054
0
votes
1 answer

Getting dynamic header height from PDF

We're using Migradoc to generate PDFs which contain headers sections so that the headers are displayed on each page. The height of the content in the header can vary though. I'm setting the position of the body content using…
Dan
  • 5,692
  • 3
  • 35
  • 66
0
votes
1 answer

Automatic PDF Rendering

I've read the MigraDoc/PdfSharp documentation, but it feels a bit thin. I want to render out a PDF, but not have to manually specify width and height. I just want it to align right, center, or left (of margins), and handle all the sizing for…
user287848
  • 141
  • 1
  • 12
0
votes
1 answer

Print PDF programmatically - C# WinForms

I need to print a SSRS report in PDF format from a WinForms application written in C#. The report is a PDF document (containing text, images & tables), in a byte array - and I don't want to save it to disk for security/performance reasons. The…