migradoc

How to add DocumentLink to existing PDF file using PdfSharp

醉酒当歌 提交于 2021-01-29 11:13:22
问题 I have several pdf files. and I want to combine all of them in one which I can do using PDFSharp. But I also want Table Of Contents at the top with DocumentLink . Table of content is separately created using Migradoc which looks as below. My question is is there any way in pdfsharp using which I can add Document link on the Document name like Document1, Document2 which redirects to respective pages. 回答1: Mixing MigraDoc and PDFsharp you can get it done. You can add a Tag to the paragraphs

Fit image onto one PDF page using MigraDoc

两盒软妹~` 提交于 2020-12-10 06:32:02
问题 I am able to easily add an image to a section in the PDF file with MigraDoc. However, the image is cut in half by the page width. Is there a way to force the picture to resize so that it completely fits on one page? Or must this be done manually? If it has to be done manually, does anyone know the dimensions of a PDF page in MigraDoc? 回答1: The image will be drawn in the size you set for the image. Image image = section.Headers.Primary.AddImage("../../PowerBooks.png"); image.Width = "2.5cm";

Is it possible to install fonts on an Azure App Service?

假装没事ソ 提交于 2020-04-13 06:49:47
问题 We are using MigraDoc/PDFsharp GDI+ which depends on having fonts installed to the system in order to render. We have tried embedding the fonts but the GDI+ version of MigraDoc does not seem to support this. When trying to move this component to an Azure App Service, it cannot find the fonts. Is there a way to "install" the fonts locally to the App Service so that they would be visible to GDI? 回答1: As I know, Components rely on GDI API may not work on Azure Web APP. We could find this known

MigraDoc/PDFsharp throwing Exceptions with Chinese YaHei font

风格不统一 提交于 2020-02-08 10:25:31
问题 Recently after moving our Website from Windows Server 2008 to Server 2016, we started facing problems exporting PDF documents from our C# code that uses MigraDoc/PDFsharp library. Problem can also be reproduced on windows 10. Exactly same code works just fine on Windows 7 or, as mentioned earlier, any server OS prior to Server 2016. Previously we were getting this exception: Error while parsing an OpenType font. InnerException: InvalidOperationException: Font has no usable platform or

MigraDoc/PDFsharp throwing Exceptions with Chinese YaHei font

二次信任 提交于 2020-02-08 10:24:28
问题 Recently after moving our Website from Windows Server 2008 to Server 2016, we started facing problems exporting PDF documents from our C# code that uses MigraDoc/PDFsharp library. Problem can also be reproduced on windows 10. Exactly same code works just fine on Windows 7 or, as mentioned earlier, any server OS prior to Server 2016. Previously we were getting this exception: Error while parsing an OpenType font. InnerException: InvalidOperationException: Font has no usable platform or

Page number resets when new section starts - MigraDoc

冷暖自知 提交于 2020-01-15 05:34:12
问题 I am using MigraDoc to create a PDF. As per my requirement, I have to add different headers according to the contents of the page\section. I am able to achieve it by adding new section and defining new header for every section. Till here, it works fine. In footer, I am showing page numbers using "AddPageField". But I realized that whenever a new section starts, page field reset to 1. Is there any way that footer continues the page count across all sections? If I use only one section

MigraDoc table with rounded corners

一笑奈何 提交于 2020-01-15 03:40:10
问题 How can I set rounded corners for a table? I'm using c# and MigraDoc. MigraDoc.DocumentObjectModel.Tables.Table myTable = section.AddTable(); myTable.Borders.Visible = true; MigraDoc.DocumentObjectModel.Tables.Column myColumn = myTable.AddColumn(); MigraDoc.DocumentObjectModel.Tables.Row myRow = myTable.AddRow(); myRow[0].AddParagraph("Some text"); 回答1: PdfSharp can do it. Not sure about MigraDoc. http://www.nudoq.org/#!/Packages/PDFsharp-MigraDoc-GDI/PdfSharp/XGraphicsPath/M

How can set the page size of MigraDoc?

非 Y 不嫁゛ 提交于 2020-01-14 14:50:08
问题 Sorry for I am just beginner of PDFsharp. How can I set PageSize to a document? Let's say A4. How to set it? Here it is my code. Thanks. Document document = new Document(); // Add a section to the document Section section = document.AddSection(); section.AddParagraph("dddddd"); // Add a section to the document var table = section.AddTable(); table.AddColumn("8cm"); table.AddColumn("8cm"); var row = table.AddRow(); var paragraph = row.Cells[0].AddParagraph("Left text"); paragraph.AddTab();

.NET C# - MigraDoc - How to change document charset?

南笙酒味 提交于 2020-01-14 09:39:49
问题 I've searched for solution to this problem, but still cannot find the answer. Any help would be appreciated. Document document = new Document(); Section section = document.AddSection(); Paragraph paragraph = section.AddParagraph(); paragraph.Format.Font.Color = Color.FromCmyk(100, 30, 20, 50); paragraph.AddText("ąčęėįųųūū"); paragraph.Format.Font.Size = 9; paragraph.Format.Alignment = ParagraphAlignment.Center; </b> <...> In example above characters "ąčęėįųųūū" are not displayed in exported

How to place an image and a paragraph on PDF document header?

蹲街弑〆低调 提交于 2020-01-06 03:31:25
问题 I'm trying to place an image and a text below this image on document header using MigraDoc . Unfortunately I'm unable to do so. It seems to only be accepting image or paragraph but not both. This is what I've tried: var image = section.Headers.Primary.AddImage("image.jpg"); var text = section.Headers.Primary.AddParagraph("title"); It may be possible that paragraph is placed under image, making it invisible. It doesn't seem to be the case though. 回答1: You can add images to paragraphs - you add