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
35
votes
5 answers

PDFsharp: Is there a way to generate "Page X of Y" in the header of the page?

It seems rather simple, but I can't find something like getPageCount() in the API. I can get it to return the current page, but not the total number of pages. Perhaps I'm missing it? I would like to somehow be able to print 'Page 1 of 9' at the top…
mkautzm
  • 1,086
  • 2
  • 18
  • 34
23
votes
3 answers

How to size a table to the page width in MigraDoc?

I am trying to resize a table automatically to full width of the page. That table should have 2 columns, 50% width each. How can I achieve this? I tried LeftIndent and RightIndent properties with no luck.
jstuardo
  • 3,901
  • 14
  • 61
  • 136
23
votes
1 answer

MigraDoc - Bold certain text in a paragraph

In MigraDoc, if I have a paragraph, how can I only bold some text in the paragraph, not the entire paragraph. Edit: Below is the typical code I would use to add a bolded paragraph. var paragraph = section.AddParagraph("This…
contactmatt
  • 18,116
  • 40
  • 128
  • 186
20
votes
1 answer

How to Set the Background Color of a Cell in a MigraDoc Table

I have a MigraDoc table where I specify a row height of 0.75cm, and the text is vertically-aligned in the middle of the cell. When I set cell.Format.Shading.Color to something non-white, there is still a portion of the cell near the border that is…
Jeff G
  • 4,470
  • 2
  • 41
  • 76
18
votes
1 answer

Keep table in one piece MigraDoc / PDFsharp

I am using PDFsharp / MigraDoc to write tables and charts to PDF files. This worked great so far, however MigraDoc will always split my tables (vertically) when it should move the whole table to the next page in the document. How do I make sure the…
David Božjak
  • 16,887
  • 18
  • 67
  • 98
16
votes
4 answers

Put an image in the center of a cell with migradoc

I need to put an image in the center of a table's cell. When I add the image in a cell the image is aligned topleft. How can I align the image in the center of a cell?
Martina
  • 791
  • 1
  • 14
  • 26
16
votes
3 answers

Migradoc Add horizontal line

How can I add a simple horizontal line in Migradoc so as to separate the content above the line from the content below the line? Paragraph 1 Paragraph 2 Paragraph 3 ETC
rikket
  • 2,357
  • 7
  • 46
  • 74
15
votes
3 answers

How do you have a bulletted list in migradoc / pdfsharp

even after reading this forum post, its still quite confusing how to create a bulletted list using migradoc / pdfsharp. I basically want to display a list of items like this: Dodge Nissan Ford Chevy
leora
  • 188,729
  • 360
  • 878
  • 1,366
14
votes
1 answer

How to Set Document Orientation (for All Pages) in MigraDoc Library?

I'm using MigraDoc to programatically generate a PDF file with text, images and tables. I need to set Document Orientation (for all pages) in the document object to Landscape. So I tried the following. document.DefaultPageSetup.Orientation =…
Shiva
  • 20,575
  • 14
  • 82
  • 112
13
votes
3 answers

MigraDoc table goes over header on page 2?

HI Im making a large table in MigraDoc and it automatically splits the table when it gets too large for on page. I have a logo in the header and my table when it goes to page 2 sits over the logo and doesnt go under. Anybody know how to make sure it…
gmoney
  • 335
  • 1
  • 5
  • 16
12
votes
4 answers

How to create a table using PDFsharp?

Just started using PDFsharp and it works fine, but now I want to create tables in my PDF, but tried other sources and found nothing. So far I know how to use graph.drawString().
Redgren Grumbholdt
  • 1,115
  • 1
  • 19
  • 36
11
votes
2 answers

Add embedded resource image to MigraDoc document

I'd like to add an image to the header of a MigraDoc document, but hardcoding a filesystem path in the document generation is slightly problematic for a number of issues - not the least of which is that it makes me a little queasy, but also, to keep…
Matt Enright
  • 7,245
  • 4
  • 33
  • 32
11
votes
0 answers

Rotate XAxis label to 90 degree

Hi I am using PDFsharp & MigraDoc to generate column chart. I was wondering, if I can rotate the x axis labels to 90 degree so they come like vertical instead of horizontal. Does any body has any idea? If not, can some one tell me any other library…
user345625
  • 3,911
  • 3
  • 16
  • 6
10
votes
1 answer

Margin in MigraDoc

I'm using MigraDoc and PDFsharp and I need to set different margins for each page in my PDF document. Using document.DefaultPageSetup.RightMargin = 20; document.DefaultPageSetup.LeftMargin = 20; I obtain that all the pages in my document will…
Martina
  • 791
  • 1
  • 14
  • 26
10
votes
2 answers

Adding links to pdf by using MigraDoc

I use MigraDoc for creating pdf documents in the project. Code below shows how I work with library: var document = new Document { Info = { Author = "title" } }; Section section = document.AddSection(); Paragraph paragraph =…
BotanMan
  • 1,357
  • 12
  • 25
1
2 3
25 26