pdf-generation

How to keep some formatting and paragraphs when using jsPDF?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 16:16:43
问题 Okay, so I have a basic table for a schedule I created for a gym. I want to be able to download that table using jsPDF. As of right now, I've been able to get the table downloading fine, however there are a few things I just can't get to work. First, I cannot, for the life of me, get the table to be full width within the PDF that get's downloaded. I've read dozens of posts about jsPDF and nothing has been able to solve the problem! Second, the information within each cell is in 3 different p

Add Empty/Blank Page to PdfDocument java

坚强是说给别人听的谎言 提交于 2019-12-11 15:26:57
问题 It is there any way to add a Blank Page to an existing PdfDocument ? I've created a method like this: public void addEmptyPage(PdfDocument pdfDocument){ pdfDocument.addNewPage(); pdfDocument.close(); } However , when I use it with a PdfDocument , it throws : com.itextpdf.kernel.PdfException: There is no associate PdfWriter for making indirects. at com.itextpdf.kernel.pdf.PdfObject.makeIndirect(PdfObject.java:228) ~[kernel-7.1.1.jar:?] at com.itextpdf.kernel.pdf.PdfObject.makeIndirect

Render User Controls and call their Page_Load

谁说胖子不能爱 提交于 2019-12-11 14:59:40
问题 The following code will not work because the controls (page1, page2, page3) require that their "Page_Load" event gets called. using System; using System.IO; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using iTextSharp.text; using iTextSharp.text.html.simpleparser; using iTextSharp.text.pdf; public partial class utilities_getPDF : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // add user controls to the page AddContentControl("controls

Html to pdf with images using hiqpdf

谁说我不能喝 提交于 2019-12-11 13:37:25
问题 I am converting a html with images and css files using HiQPdf 8.0 . I have done it lots of times in MVC 4 . Now I am working under MVC 5 and HiQPdf 8.0 and the problem is HiQPdf 8.0 is not loadin external files like css files and images. I solved the issue with css files by writhing the styles in a style tag in the page but do not know how to handle images. Here is my solution: byte[] pdf = RenderPdf(contractId.Value, personId.Value, addressId.Value, transportId.Value, peacockeryNumber,

iTextSharp. How to get specific types from AcroFields? Like PushButtonField, RadioCheckField, etc

♀尐吖头ヾ 提交于 2019-12-11 13:32:51
问题 I am trying to cast AcroFields to the specific types so I can set properties on them. When I call AcroFields.GetField(string name); all I get is a string. When I call AcroFields.GetFieldItem(string name); I get an object but cannot cast it to the specific type. I have also tried: AcroFields.SetFieldProperty("myfield", "CheckType", RadioCheckField.TYPE_STAR, null); This returned false every time. To better explain my scenario: I have an existing PDF ( I am NOT generating this file ). There is

Jasper Reports not displaying pdf on browser, shows no error on console

不羁的心 提交于 2019-12-11 12:25:31
问题 This is a snippet of my Java class code Case 1 request=ServletActionContext.getRequest(); response = ServletActionContext.getResponse(); if(response!=null) System.out.println("Response is not null"); System.out.println("coming to this method"); inputStream= this.getClass().getClassLoader().getResourceAsStream("com/ram/report/jasper/Report.jrxml"); JasperReport jasperReport=JasperCompileManager.compileReport(inputStream); HashMap<String, Object> params = null; JasperPrint jp=JasperFillManager

How to load custom font in FontFactory.register in iText

試著忘記壹切 提交于 2019-12-11 12:12:31
问题 I need your help in adding a custom font "arial.ttf" which is stored under the resources folder in my project in the FontFactory.register method in iText. The font path is as follows in the project from Windows Explorer: public_html\resources\fonts\arial.ttf The code for referring to the font is: FontFactory.register("/resources/fonts/arial.ttf", "my_bold_font"); Font myBoldFont = FontFactory.getFont("my_bold_font"); However when I ran the Java method, it always gives me the error: java.io

iOS: Rendering UITableView into PDF

孤人 提交于 2019-12-11 11:47:52
问题 I have written pdfGenerator class to render whole UITableView to generate PDF. Usage: [pdfGenerator createPDFFromTableview:self.tableView]; Class Methods: - (void)createPDFFromTableview:(UITableView *)tableview { [tableview scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; [self renderTableView:tableview]; int rows = [tableview numberOfRowsInSection:0]; int numberofRowsInView = 17; for (int i = 0; i < rows

mozilla pdf.js without fullview

≯℡__Kan透↙ 提交于 2019-12-11 10:59:11
问题 I liked this pdf viewer https://github.com/mozilla/pdf.js/ Demo: http://mozilla.github.com/pdf.js/web/viewer.html I want to open this in a div (say 400px width) How can I do that? Right now I am seeing only full view of this viewer. 回答1: The best way is with a iframe, if it is what you mean. You want to see that page inserted on your page? If its, use and set the size and scroolbars properties to see it on the size that you want, there is the property src i think where you can put the url. 来源

PDF issue while reaching end of page

我的梦境 提交于 2019-12-11 10:42:09
问题 Well I'm having some troubles when creating new pages. I get my data from a query. Sorry if I post a lot of code, but it's all needed and I'm not sure how to do a MCVE as I'm pretty new at working with PDF. This issue is: Before writing next block of code I check current Y coord, I can achieve this, but when I need to create new Page and start writing again, well happens this Here are the codes used in the PDF: public float checkContentStream(float y) throws Exception { float newY =