pdf-generation

Vector graphics with ITextSharp

馋奶兔 提交于 2019-12-02 07:17:21
问题 I have heard that ITextSharp does not have support for the JAVA2D class, does this mean that i cant import vector points from a clients databas to "print" to a ITextSharp application? I would relly like to find answer to this before going further with this suggestion. Anyone have real experiences of this? 回答1: While it is true that you can't use JAVA2D with iTextSharp you can still draw vector graphics in a PDF-native way by writing directly to the PdfWriter.DirectContent object. It supports

Python-Pie chart in reportlabs

断了今生、忘了曾经 提交于 2019-12-02 07:16:56
I'm referring this link for generation of Pie Chart. In this the colors are pre-defined for each data, ie 10 colors for 10 data points. What if I have 11 data points and then there will be no color for that 11th data point. I want something dynamic which should automatically pick a color by itself and plot it on the pie. I found this link and this link , but the colors over here are not catchy and not at all good. Can someone please brief me about how to get catchy colors in pie graph? Thanks You can also provide from reportlab.lib.colors import Color like: Color(red=0, green=0, blue=1, alpha

Adding form elements to a table with iTextSharp

感情迁移 提交于 2019-12-02 06:52:45
问题 I'm trying to create a PDF document that is essentially a list of users in a table format. I need the table to have checkboxes in it. So far, I have the table and the checkboxes separately but I cannot find a way to get the checkboxes in the table. I think I need to add them using the AddCell() method. Here is my code: static void Main(string[] args) { // create the document, filestream, writer Document doc = new Document(PageSize.LETTER); FileStream file = new FileStream(@"C:\Users\test\User

How to set background image in PdfPCell in iText?

微笑、不失礼 提交于 2019-12-02 06:36:26
I am currently using iText to generate PDF reports. I want to set a medium size image as a background in PdfPCell instead of using background color. Is this possible? You can find an example on how to do this with iText 5.5.1 here . You need to create your own implementation of the PdfPCellEvent interface, for instance: class ImageBackgroundEvent implements PdfPCellEvent { protected Image image; public ImageBackgroundEvent(Image image) { this.image = image; } public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) { try { PdfContentByte cb = canvases[PdfPTable

Cannot get CSS to work in iTextSharp (5.4.3) when making pdf

跟風遠走 提交于 2019-12-02 06:00:43
I have a problem trying to apply a css file to my pdf using the iTextSharp (5.4.3) generation library. basically the css is not being applied at all. I have the following method in my vb.net file Protected Sub btnPreview_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPreview.Click Dim bytes As Byte() bytes = System.Text.Encoding.UTF8.GetBytes(letterRadEdit.Content) Dim tagProcessor As tool.xml.html.DefaultTagProcessorFactory() Using input As New MemoryStream(bytes, False) Dim ms As New MemoryStream() Dim document As New iTextSharp.text.Document(iTextSharp.text.PageSize

How to keep original rotate page in itextSharp (dll)

坚强是说给别人听的谎言 提交于 2019-12-02 05:57:52
i would like create the project, reading from Excel and write on pdf and print this pdf. From Excel file (from cell) read directory where is original pdf on computer or server, and next cell have info what write on the top in second pdf. And problem is here, original pdf is horizontal, landscape, rotate and my program create copy from original pdf and write info from excel on the top on copy pdf file. But pdf which is landscape is rotate for 270 deegres. This is no OK. For portrait rotation working program OK, copy OK and write on the top of the copy is OK. Where is my problem in my code. Code

Attaching files to a PDF

 ̄綄美尐妖づ 提交于 2019-12-02 05:03:51
I am struggling with attaching files to a PDF that I am generating at runtime. I'm using C# ASP.net in the MVC framework. I originally created the PDF using ABCpdf from a HTML View but I then realised, I also needed to attach files to the PDF. I switched to using iText and I have managed to attach a file to the PDF using the solution at iTextSharp for PDF - how add file attachments? The problem I have now is that I can't seem to reference these attachments as links within the PDF. The "iText in Action" book suggests I can use annotations or document level attachments. I don't find the book

Portuguese/Spanish accents with jsPDF

此生再无相见时 提交于 2019-12-02 03:49:32
问题 How can I manage to get special characters in a PDF file generated with jsPDF? The texts are dynamically loaded through AJAX. Some possible chars are à , É , Ç and õ . I, up to now, didn't get how to do this. 回答1: You must download the last version of jsPDF, there will be a file called jspdf.plugin.standard_fonts_metrics.js, just reference that script from your html page and that would be more than enough to user special caracters would be a simple line like this: <script src="jspdf.plugin

ASP.NET page to image or PDF

血红的双手。 提交于 2019-12-02 03:44:38
问题 I have an ASP.NET page like this: http://farm4.static.flickr.com/3631/3690714302_c17b259863.jpg My table is Gridview and some Label , anybody can tell me how to create a button to convert my page to image or PDF file and save it to desktop. 回答1: It can be done by code on the backend that renders the html into a memory Graphic object and then serves that resultant bitmap back, or by printing the page (on the server) through a PDF writer and then capturing the result. Javascript, no. Or google

TCPDF_import is not bringing in an existing file

冷暖自知 提交于 2019-12-02 03:32:38
问题 I have a PDF of a blank certificate, I want to fill in two lines when the user completes a course of study, and display the PDF so they can print or download it. I am using TCPDF to write the two lines on an existing PDF. Per suggestions in a previous post ( using PHP to fill in a PDF ), I am using TCPDF_IMPORT to bring an existing PDF into the object, and writing on top of it. However, the original PDF does NOT show on the screen, I am left with a blank document, with only the lines of text