pdf-generation

How can I create buttons to add to a PDF file using iTextSharp?

≡放荡痞女 提交于 2020-01-07 05:06:07
问题 I'm creating "labels" and textboxes and checkboxes using iTextSharp, but my attempts to derive from that code to create buttons has not yet been successful. Here is how I'm creating textBoxes: PdfPCell cellRequesterNameTextBox = new PdfPCell() { CellEvent = new DynamicTextbox("textBoxRequesterName") }; tblFirstRow.AddCell(cellRequesterNameTextBox); . . . public class DynamicTextbox : IPdfPCellEvent { private string fieldname; public DynamicTextbox(string name) { fieldname = name; } public

Check boxes in user form to select sheets to print

时光总嘲笑我的痴心妄想 提交于 2020-01-07 03:53:21
问题 I have code that selects an array of sheets to be printed to a pdf document, however I am trying to implement a user form with a series of check boxes that correspond to a specific sheets. The following code selects a predetermined array of sheets and prints them as a pdf Sub PDFAllSheets_Click() Dim ws As Worksheet Dim strPath As String Dim myfile As Variant Dim strFile As String Dim sheetstoprint As String On Error GoTo errHandler Set ws = ActiveSheet strFile = "E_CALC_" & Worksheets(

HPDF_SetCompressionMode() not working in Libharu

戏子无情 提交于 2020-01-07 03:02:38
问题 I am generating Pdf files using LibHaru libraries. My code is following #include <iostream> #include "hpdf.h" using namespace std; void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void *user_data) { } int main() { cout<<"Compression"<<endl; HPDF_Doc pdf = HPDF_New(error_handler, NULL); if (!pdf) return 0; HPDF_STATUS Status = HPDF_SetCompressionMode(pdf, HPDF_COMP_ALL); return 0; } PROBLEM: I debugged the code and found that HPDF_SetCompressionMode() returns 4129 , which is the

Is Document doc.Add(pdf) possible?

ぐ巨炮叔叔 提交于 2020-01-07 02:06:10
问题 I am trying to add pdf to another pdf. Document doc.Add(IElement) is what I know to do and I am having trouble adding the pdf. I tried adding image and that worked. How do I add a pdf file to my document? iTextSharp.text.Image img; foreach (var buf in List) { myDoc.NewPage(); img = iTextSharp.text.Image.GetInstance(buf); img.ScaleToFit(612f, 792f); img.Alignment = iTextSharp.text.Image.ALIGN_CENTER | iTextSharp.text.Image.ALIGN_MIDDLE; myDoc.Add(img); } 回答1: You can't use Document.Add() but

Using mpdf with codeigniter generate blank output

谁说胖子不能爱 提交于 2020-01-06 19:17:27
问题 I have been flowing this post to generate a pdf but the output is blank and there is no error displayed , i have put : public function generate_pdf() { $this->load->library('mpdf'); $mpdf=new mPDF('utf-8','A4'); $mpdf->WriteHTML('<p>HTML content goes here...</p>'); $mpdf->Output(); } When i put : public function generate_pdf() { $this->load->library('mpdf'); $mpdf=new mPDF('utf-8','A4'); $mpdf->debug = true; $mpdf->WriteHTML('<p>HTML content goes here...</p>'); $mpdf->Output(); } referred to

What's needed to handle annotation viewing in a PDF?

萝らか妹 提交于 2020-01-06 14:50:10
问题 Hey everyone, I am working on parsing the PDF content stream to be able to read and handle annotation operators and also to add these. Can anyone shed some light on how to go about doing this, without using a prebuilt library? I understand it is a daunting exercise, but any pointers would be appreciated. Note: I've read a fair amount of the PDF Reference from Adobe, and mostly understand the concept of the file being an object tree, yet I don't understand how to go about figuring out if an

PDFKit, Not able to open the pdf generated

风格不统一 提交于 2020-01-06 14:46:27
问题 I am trying to generate a pdf using some texts of my own (and not a html page). I tried using PDFKit. I am able to generate the pdf but then I am not able to open it in Preview (It may be damaged or use a file format that Preview doesn’t recognize.) Below is the code, var fs = require('fs'); PDFDocument = require ('pdfkit'); var doc = new PDFDocument // Embed a font, set the font size, and render some text doc.text('Some text with an embedded font!', 100, 100) // Add another page doc.addPage(

PDFKit, Not able to open the pdf generated

拈花ヽ惹草 提交于 2020-01-06 14:46:13
问题 I am trying to generate a pdf using some texts of my own (and not a html page). I tried using PDFKit. I am able to generate the pdf but then I am not able to open it in Preview (It may be damaged or use a file format that Preview doesn’t recognize.) Below is the code, var fs = require('fs'); PDFDocument = require ('pdfkit'); var doc = new PDFDocument // Embed a font, set the font size, and render some text doc.text('Some text with an embedded font!', 100, 100) // Add another page doc.addPage(

Stuck on creating pdf file with iText

佐手、 提交于 2020-01-06 13:55:19
问题 I am trying to create pdf files using iText. I included itextpdf-5.5.3.jar into my project and following steps in this tutorial: http://blog.mettletech.co/wp/blog/generate-pdf-file-in-android/ But when this code i getting following errors: 10-30 16:52:57.163: E/dalvikvm(28969): Could not find class 'com.itextpdf.awt.PdfPrinterGraphics2D', referenced from method com.itextpdf.text.pdf.PdfContentByte.createPrinterGraphicsShapes 10-30 16:52:57.213: E/dalvikvm(28969): Could not find class 'java

Can I use an iTextSharp cell event to repeat data on the next page when a row is split?

末鹿安然 提交于 2020-01-06 08:39:58
问题 I have a very deep row in a pdfptable. The columns in the left-hand side of this row contain a sub table which has many rows within it. I would like the deep row to split onto more than one page if it is too deep to fit on one page. I can set SplitLate to false to ensure that the row splits. However, the data for the deep columns on the right hand side only shows on the first page and I would like it to be repeated on the second page. A bit of investigation suggested that I could use a cell