pdf-generation

Using jspdf to save html page as pdf, saved pdf contains incomplete page content if browser is zoomed, Why?

主宰稳场 提交于 2019-12-01 07:17:15
I am using jspdf and html2canvas combination to save html page as pdf. A pdf copy of current page is saved the moment you click a button. The problem is, if you zoom in the page, and then click the button, the saved pdf contains incomplete portion of the current page. Most of the part not visible on page due to zooming, gets cut off in the saved pdf page. What is the solution? Below is the js code being invoked upon click of save button- var pdf = new jsPDF('l', 'pt', 'a4'); var source = $('#someId')[0]; var options = { background : '#eee' }; pdf.addHTML(source, options, function(){ pdf.save(

How to render a pdf from bytestream in ajax response

喜欢而已 提交于 2019-12-01 06:48:20
I am working on a mobile application.we are using jquery-mobile. we have an option to view or download the records in pdf format. I dont have the control on backend. I will get the pdf data in json object as an ajax response.I want to read that data and display in a pdf. I have next and previous links are also in the page so we need to display pdf in a div. var data = { .... : ...., .... : ...., "pdfstream" : "KioqKioqKioqKioq......", ..... : .... } am able to read all the data but not sure how can i read that bytestream and display as an pdf in the page. UPDATE: My code is working fine. But

Write PDF text to a PDFContext in iOS

让人想犯罪 __ 提交于 2019-12-01 06:44:51
问题 It's pretty trivial to draw to a pdf context via: UIGraphicsBeginPDFContextToFile(pdfFile, CGRectZero, nil); UIGraphicsBeginPDFPageWithInfo(sheet.frame, nil); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGRect text_rect = ... NSFont *font = ... NSString * str = @"foo"; [str drawInRect:text_rect withFont:font]; ...draw to context... However the text is clearly rasterized... Is there anyway to actually add pdf style text to a pdf file? So the user can select it, copy it, etc. Possibly

java itext create pdf with hebrew (rtl) and english

南楼画角 提交于 2019-12-01 06:37:04
I want to create a pdf document containg english and hebrew together , I can see hebrew letters by using: BaseFont unicode = BaseFont.createFont("c:/windows/fonts/arialuni.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); but i see them in reverse. I want to be able to show the hebrew strings in rtl mode , and that the english strings will stay in ltr mode. how can this be done? Is there an example of english and hebrew together? (or any other rtl languge). Thank's In Advance. You should be able to draw your text via an instance of ColumnText and get full BiDi support. You just need to

How to resize an iTextSharp.text.Image size into my code?

一笑奈何 提交于 2019-12-01 06:25:31
问题 I am pretty new in iText nd iTextSharp (the C# version of iText) and I have the following problem. I am inserting some jpg charts inside my PDF. These charts are rapresented by some jpg like this one: I insert it into a table of my PDF in this way: iTextSharp.text.Image img = null; .......................................... .......................................... .......................................... if (currentVuln.UrgencyRating > 0) { img = ChartHelper.GetPdfChartV2((int)currentVuln

iText Add values to placeholders in PDF cover page dynamically

大城市里の小女人 提交于 2019-12-01 06:21:14
I have the following cover page. I need to add values for Licensee , date and fill in the box with another text given. How can this be done using iText. Any help is appreciated. First you need to create a form that will act as a template for all your license document. Section 5.3.5 of Chapter 6 of "iText in Action" (a chapter that can be downloaded for free) explains how to create such a form using OpenOffice, but there are many alternative ways to do this. I created such a form using Adobe Acrobat: CertificateOfExcellence.pdf I highlighted the fields so that you can see where I've added them.

Create PDF in Swift

橙三吉。 提交于 2019-12-01 06:05:00
问题 I am following Apple's Docs to create a PDF file using Xcode6-Beta6 in Swift var currentText:CFAttributedStringRef = CFAttributedStringCreate(nil, textView.text as NSString, nil) if (currentText) { // <-- This is the line XCode is not happy // More code here } Compiler throws Type 'CFAttributedStringRef' does not conform to protocol 'BooleanType' error If I use if(currentText != nil) I get 'CFAttributedStringRef' is not convertible to 'UInt8' From Apple's Docs for CFAttributedStringCreate

iText Add values to placeholders in PDF cover page dynamically

前提是你 提交于 2019-12-01 05:45:52
问题 I have the following cover page. I need to add values for Licensee , date and fill in the box with another text given. How can this be done using iText. Any help is appreciated. 回答1: First you need to create a form that will act as a template for all your license document. Section 5.3.5 of Chapter 6 of "iText in Action" (a chapter that can be downloaded for free) explains how to create such a form using OpenOffice, but there are many alternative ways to do this. I created such a form using

Android PdfDocument file size

倾然丶 夕夏残阳落幕 提交于 2019-12-01 05:39:49
I want to generate a PDF File from a View using the PdfDocument android class introduced in KitKat. I managed to do it, and the file is so far generated ok, ending up having a correct PDF. The only problem is the file is huge, 12Mb for just one page. Is there a way to reduce the File size? The code I am using to generate the PDF is: public static File generateDocument(Activity activity, String fileName, ViewGroup container) throws IOException{ File f = new File(activity.getExternalFilesDir(null), fileName); PdfDocument document = new PdfDocument(); try{ for(int i=0;i<container.getChildCount()

How to Set Document Orientation (for All Pages) in MigraDoc Library?

倖福魔咒の 提交于 2019-12-01 05:21:44
I'm using MigraDoc to programatically generate a PDF file with text, images and tables. I need to set Document Orientation (for all pages) in the document object to Landscape . So I tried the following. document.DefaultPageSetup.Orientation = Orientation.Landscape; But I get the following debug assertion error. --------------------------- Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue --------------------------- DefaultPageSetup must not be modified If I click Ignore , it goes through and the Orientation is indeed Landscape . However, I want to make sure I am doing this the right