pdfsharp

PDFsharp page size and set margin issue c#

纵饮孤独 提交于 2019-12-21 12:28:39
问题 I am converting an image to pdf using PDFsharp lib. I need to set margin & page size so I got a trick from this forum to set page size and margin. From here I got code which I used but getting error for two area. Here is code which I got. page = document.AddPage(); //page.Size = PdfSharp.PageSize.A4; XSize size = PageSizeConverter.ToSize(PdfSharp.PageSize.A4); if(page.Orientation == PageOrientation.Landscape) { page.Width = size.Height; page.Height = size.Width; } else { page.Width = size

Does PDF file contain iref stream?

北慕城南 提交于 2019-12-21 11:05:08
问题 I still fight with read data from PDF file. I use PDFsharp, how can I check if file contains iref stream without use method Open. Method Open throws exception if file contains iref stream . 回答1: There is a know workaround to permit you to open ALSO the pdf files that contains iref: you can find here the complete thread about that. Just to summarize the solution: download and include the iTextSharp 4.1.6 library paste the following code in a code file into your project: - using System; using

Does PDF file contain iref stream?

China☆狼群 提交于 2019-12-21 11:04:11
问题 I still fight with read data from PDF file. I use PDFsharp, how can I check if file contains iref stream without use method Open. Method Open throws exception if file contains iref stream . 回答1: There is a know workaround to permit you to open ALSO the pdf files that contains iref: you can find here the complete thread about that. Just to summarize the solution: download and include the iTextSharp 4.1.6 library paste the following code in a code file into your project: - using System; using

WPF DataGrid GridLines not visible when saved as PDF

流过昼夜 提交于 2019-12-20 07:11:48
问题 I'm using a DataGrid to represent some data in a WPF application. In a feature where I'm saving a particular WPF Window which has the DataGrid into a PDF using PDFSharp, I'm facing an issue that the DataGrid GridLines are not visible when the saved PDF is viewed in smaller viewing percentages. (Refer attached images, only when the PDF view is set at 139%, the GridLines are visible. However, in smaller viewing %, some grid lines get omitted.) Here's the PDF Saving Code:- MemoryStream

Programmatically print to a PDF printer [closed]

梦想与她 提交于 2019-12-20 04:31:36
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am looking for a free open source .Net based, preferably C# , pdf printer such as CutePDF's Custom PDF Writer with programmatic

Programmatically print to a PDF printer [closed]

老子叫甜甜 提交于 2019-12-20 04:31:13
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am looking for a free open source .Net based, preferably C# , pdf printer such as CutePDF's Custom PDF Writer with programmatic

PDFSharp private fonts for azure 1.50

不羁的心 提交于 2019-12-20 02:17:05
问题 I have downloaded and installed PDFSharp 1.5 and I am having trouble using private fonts. I have created in testing a pdf creator and it works great. When I load it into Azure it gives me the error can't load font. Did research and found out that they do not have any loaded fonts so I must use private font. I can only find examples of the older 1.3 version and the methods are changed to new ones. Can somebody show me a simple example using the new version of PDFSharp? Thanks John 回答1: This is

PDFsharp edit a pdf file

放肆的年华 提交于 2019-12-18 11:06:40
问题 Environment - PDFsharp Library, Visual Studio 2012 and C# as the language. I am trying to: read Test1.pdf (Width = 17 inches, Height – 11 inches) with 1 page add some text to it save it as another file (Test2.pdf) I am able to do all the following. But when I open the file Test2.pdf the size of the page is getting reduced to Width = 11 inches, Height – 11 inches. These PDF files that I am using are Product Specification Sheets that I have downloaded from the internet. I believe this is

Generate PDF based on HTML code (iTextSharp, PDFSharp?)

早过忘川 提交于 2019-12-17 22:25:11
问题 Does the library PDFSharp can - like iTextSharp - generate PDF files * take into account HTML formatting * ? (bold (strong), spacing (br), etc.) Previously I used iTextSharp and roughly handled in such a way (code below): string encodingMetaTag = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"; string htmlCode = "text <div> <b> bold </ b> or <u> underlined </ u> <div/>"; var sr = new StringReader (encodingMetaTag + htmlCode); var pdfDoc = new Document (PageSize.A4,

PDFsharp - How to create a 2nd page

这一生的挚爱 提交于 2019-12-17 16:37:52
问题 I can't find documentation in PDFsharp to show how to add a 2nd page using C#! As an example, over in VB6 I use a PDF creation method called mjwPDF. To indicate that the page is finished objPDF.PDFEndPage And to start a new page: objPDF.PDFNewPage My PDFsharp initial settings: // Create a new PDF document PdfDocument document = new PdfDocument(); // Create an empty page PdfPage page = document.AddPage(); //page.Contents.CreateSingleContent().Stream.UnfilteredValue; // Get an XGraphics object