pdf-generation

Create PDF iOS7

蓝咒 提交于 2019-12-03 00:48:18
to create a pdf programmaticallly inside my iOS app I followed this tutorial on mobile.tut+: http://mobile.tutsplus.com/tutorials/iphone/generating-pdf-documents/ but two methods are now deprecated in iOS7, but what xcode suggest to use instead of old methods doesn't seems to work. somebody have an idea? thanks! - (CGRect)addText:(NSString*)text withFrame:(CGRect)frame fontSize:(float)fontSize{ UIFont *font = [UIFont fontWithName:@"HelveticaNeue-Light" size:fontSize]; NSMutableParagraphStyle *paragraph = [[NSMutableParagraphStyle alloc] init]; paragraph.alignment = NSTextAlignmentNatural;

ASP.NET MVC: render view to generate PDF: use iTextSharp or better solution?

半城伤御伤魂 提交于 2019-12-03 00:47:50
I display receipt in both HTML and printer-friendly version. HTML version does jQuery tabs, etc, while printer-friendly has zero scripts and external dependencies, no master layout, no additional buttons, inline CSS, and can be saved as HTML without problems. Since I use Spark View Engine, I though maybe it's a good idea to generate PDF using iTextSharp engine. But after few paragraphs I decided it's too cumbersome, because a) I would have to rewrite entire receipt (source Spark view is about 5 pages long) b) I had problems with iTextSharp from beginning - for example, numbered lists kept

Creating a PDF and sending by email

喜夏-厌秋 提交于 2019-12-03 00:37:02
I am looking at the ablity for users to enter some information into a form and send it via mail() . What I'd like is for the details to be sent as a PDF attachment. Possibly with the name of the the sender and a date/time. test_user_06052011.pdf I have a design for the PDF, but I'm not sure how I'd integrate this design to create a PDf in PHP. Does anyone have an examples or ways in which I could do this? Have a look into FPDF - http://www.fpdf.org/ - It's free and a great tool for generating PDF's There is a PDF generator which is recomended by PHP, however it'd very expensive and the name

Default paper size and unit for PDF documents on iOS

狂风中的少年 提交于 2019-12-02 23:37:07
For creating PDF documents in iOS, in the official documentation ( http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GeneratingPDF/GeneratingPDF.html#//apple_ref/doc/uid/TP40010156-CH10-SW3 ), the default size is given as 612x792, which has a ratio of 1.29412. // Create the PDF context using the default page size of 612 x 792. UIGraphicsBeginPDFContextToFile(pdfFileName, CGRectZero, nil); CFRange currentRange = CFRangeMake(0, 0); NSInteger currentPage = 0; BOOL done = NO; do { // Mark the beginning of a new page. UIGraphicsBeginPDFPageWithInfo

How to calculate the height of an element?

萝らか妹 提交于 2019-12-02 23:23:02
问题 I am generating pdf files by XML data. I calculate the height of a paragraph element as : float paraWidth = 0.0f; for (Object o : el.getChunks()) { paraWidth += ((Chunk) o).getWidthPoint(); } float paraHeight = paraWidth/PageSize.A4.getWidth(); But this method does not works correctly. Can you give me an idea? 回答1: Your question is strange. According to the header of your question, you want to know the height of a string, but your code shows that you are asking for the width of a String.

iTextSharp: Why when adding a image to a pdf page the text font is different?

一个人想着一个人 提交于 2019-12-02 22:09:55
问题 I use Helvetica font and 14 px size for text. The problem is that if a page does not have any image on it the text is very clear, but in a page with at least 1 image the text is getting a little bold. You can see what I mean in images below: * Without image on page * With image on page The correct font is the one that appear in picture #1. How to make all pages have the same font even if the page contains an image or not? Thanks. Sample code: Document document = new Document(PageSize.LETTER);

Embed custom font in a PDF generated from iPad Application

烈酒焚心 提交于 2019-12-02 21:22:31
Overview I am generating a four page PDF document in an iPad application that uses a custom font, Trade Gothic. It is embedding correctly into the application, and looks great. However, part of the app is to email the PDF as a leave behind. This sent file displays all font as a default sans type and on a few systems, I received the error Cannot find or create the font 'RVYPRT+TradeGothicLTStd-Light'. Some characters may not display or print correctly. I am generating the PDF using the UIKit Framework. Here is a tutorial that uses the same process: http://www.ioslearner.com/generate-pdf

Adding an image to a pdf with pdftk

北城余情 提交于 2019-12-02 21:02:04
Hello I am using pdftk to generate a PDF based on a form that is submitted. I have everything working fine until here. Which is adding an image of a signature. I am using signature pad which works great to generate the image file of the signature. Now i am trying to add that signature image to the PDF? Does anyone know if this is even possible to do with pdftk? i don't see the option to do that. Or if its even possible to attach to the image to a form filed that i have in the PDF? First convert the image to PDF convert image.png image.pdf Then scale up and offset the image using pdfjam

Best way to create/fill-in printed forms and pdfs?

拈花ヽ惹草 提交于 2019-12-02 20:57:23
We have a C# application that must print complex forms. Things like multi-page government compliance forms that must be in a specific format. We can get PDF copies of these forms and create form fields, but aren't sure how to fill in this data and create a PDF that can be auto-printed and sent to our clients (they need paper copies). Also, some of the forms are dynamic, in that certain pages must be repeated (for example, for an employee equal opportunity audit report we might need to include 5 copies of a page in the form if it holds 50 employees but the client has 250). In general, what's

How to print a QQuickView's contents to PDF?

依然范特西╮ 提交于 2019-12-02 20:53:57
I'm upgrading some Qt (C++ & QML) code from Qt4.8 to Qt5.1. The Qt4.8 code is a trivial C++ "QML viewer" app subclassing a QDeclarativeView , and a bunch of QML. It's been easy enough to change this to use Qt5/QtQuick2's QQuickView except for one thing: The Qt4.8 app has a method for printing to PDF: void MyQMLViewer::printToPDF(const QString& filename) const { QPrinter printer(QPrinter::HighResolution); printer.setOutputFormat(QPrinter::PdfFormat); printer.setPageSize(QPrinter::A3); printer.setOutputFileName(filename); printer.setOrientation(QPrinter::Landscape); QPainter painter(&printer);