pdfsharp

PDFSharp with Chinese characters

ε祈祈猫儿з 提交于 2019-12-11 03:07:59
问题 I have problem with displaying Chinese characters in PDFSharp in C#. During process of creating the PDF string it's ok, but after creating pdf file it doesn't display it. I found one solution which is XFont font_small2 = new XFont("微软雅黑", 9, XFontStyle.Regular, options) This solutions works on my localhost but when I release this on beta server it doesn't display Chinese characters. 回答1: You can embed original Chinese font into your pdf file and use correct CMAP. var options = new

How to programmaticaly construct PDFs with PDF/A format

谁说我不能喝 提交于 2019-12-11 01:48:24
问题 I need to write a NET application that will take various data from databases and construct a PDF which must be in PDF/A format because of the companies standards. So far I have looked at PDFSharp and iTextSharp I see a topic in PDFSharp forums http://forum.pdfsharp.net/viewtopic.php?p=1293#p1293 dicussing this very topic and they have said years ago that PDF/A support is in their todo list, but nothing came of it. I cannot find any information about PDF/A format using these libraries. Do I

MigraDoc table border issue with left indent

社会主义新天地 提交于 2019-12-11 01:21:52
问题 I'm trying to create a PDF document using MigraDoc, and am facing issues with table borders when the table contains a left indent. I'm passing data to the following functions to render the table. public void AddTable(int _iNumberOfColumns, double leftInd) { table = section.AddTable(); if (leftInd != 0d) { table.Format.LeftIndent = leftInd; } for (int i = 0; i < _iNumberOfColumns; i++) { Column col = table.AddColumn(); } } In the above method I'm passing a double value for the parameter

Find char width in pixels for various Arial fontsizes

只愿长相守 提交于 2019-12-10 23:58:28
问题 I have a program that is manually generating a PDF using PDFsharp in C#. Although it is rather tedious I have to use it and am nearing completion of the task. Only one issue remains. Problem: I am wondering how I can find out what the width of a given char is for a given font size in Arial. I am having trouble coming up with a more precise text wrapping method. Right now one defines a width of box in pixels and then proceeds to write out a string in that box. I kinda just guess at the max

Rendering multiple .rdlc reports into a single PDF using PDFSharp

社会主义新天地 提交于 2019-12-10 16:49:57
问题 I am running multiple reports and combining them into a single PDF file. For each report, I pass the datasource, parameters, and report path to the following. The result is a PDF file with the correct number of pages, but all pages are blank. What am I missing? LocalReport report = null; PdfDocument pdfDoc = new PdfDocument(); private void ProcessReport( ReportDataSource reportDS, ReportParameter[] reportParms, string reportPath) { string format = "PDF"; string deviceInfo = null; string

MigraDoc: Setting font for a document

允我心安 提交于 2019-12-10 11:27:22
问题 I'm wanting to use a different font with MigraDoc, but I'm having a hard time getting it to stick. Currently, I'm working with the following code: I have this as a class-wide variable: String tPdfFont = "MonospaceTyperwriter"; Then the MigraDoc code itself: Document tDoc = new Document(); MigraDoc.DocumentObjectModel.Style style = tDoc.Styles["Normal"]; style.Font.Name = tPdfFont; That particular font is installed on the machine, but it doesn't seem to work. I feel like I'm missing something

Image Opacity in PdfSharp.NET

Deadly 提交于 2019-12-10 10:43:46
问题 I'm using PDFSharp.NET library to watermark a list of PDFs file. Everything works fine, the website has a lot of samples. http://www.pdfsharp.net/wiki/Graphics-sample.ashx The last thing I need is to add the Company Logo, which is big, in the middle of the PDF Page. I can use a PNG, so that areas which are set as transparent do not "cover" the PDF page". The pdf is not generated using PDFSharp, but is an "Image" PDF. For this reason, what I need, is, in addition to the transparency, which

C# PDFSharp: Examples of how to strip text from PDF?

旧巷老猫 提交于 2019-12-10 04:35:42
问题 I have a fairly simple task: I need to read a PDF file and write out its image contents while ignoring its text contents. So essentially I need to do the complement of "save as text". Ideally, I would prefer to avoid any sort of re-compression of the image contents but if it's not possible, it's ok too. Are the examples of how to do it? Thanks! 回答1: Extracting text from a PDF file with PDFsharp is not a simple task. It was discussed recently in this thread: https://stackoverflow.com/a/9161732

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

白昼怎懂夜的黑 提交于 2019-12-10 01:12:16
问题 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. 回答1: Here's an approach that avoids hardcoding widths and allows for more flexible paper formats. Make sure to include the using MigraDoc.DocumentObjectModel; statement in your class. Document document = new Document(); Section section = document.AddSection(); section.PageSetup.PageFormat =

pdfsharp - font embed?

落爺英雄遲暮 提交于 2019-12-09 17:58:27
问题 I am given a file that has some other language font. They can not download the font, so they want me to embed it in the pdf. Now, I only have PDF Reader, so I cant edit or create a pdf file. so I decided to quickly do it in C#.NET using PDFSharp library, but I just cant seem to figure out how to embed fonts using pdfSharp?! Also, it's only 1 file that I have to process, so if you know of a way to do it manually, then that would be great too. 回答1: There are two ways to do this. For each font