Tag: pdf generation

iOS:将UITableView呈现为PDF

我已经写了pdfGenerator类来呈现整个UITableView来生成PDF。 用法: [pdfGenerator createPDFFromTableview:self.tableView]; 类方法: – (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/numberofRowsInView; i++) { [tableview scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(i+1)*numberofRowsInView inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; [self renderTableView:tableview]; } } – (void)renderTableView:(UITableView*)tableview { UIGraphicsBeginImageContext(tableview.frame.size); [tableview.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *tableviewImage = […]

ios-pdf在uiscrollview中生成

在我的iOS应用程序,我列出了滚动视图中的一些数据。 点击button时,页面中的数据以pdf文件格式生成。 以下是一些代码。 – (void)createPDFfromUIView:(UIView*)aView saveToDocumentsWithFileName:(NSString*)aFilename{ // Creates a mutable data object for updating with binary data, like a byte array NSMutableData *pdfData = [NSMutableData data]; // Points the pdf converter to the mutable data object and to the UIView to be converted UIGraphicsBeginPDFContextToData(pdfData, aView.bounds, nil); UIGraphicsBeginPDFPage(); CGContextRef pdfContext = UIGraphicsGetCurrentContext(); // draws rect to […]

目标c中从uiwebview生成PDF的问题

我已经在uiwebview中打开pdf文件,在uiwebview子视图中添加图像和文本。然后我尝试创buildPDF文件。 下面我用来生成pdf文件的示例。 在单页中写多页。 我如何写样本质量和确切的大小。 请检查屏幕截图和源代码 UIGraphicsBeginPDFContextToData( pdfData, CGRectZero, nil ); for (int i = 0; i < 10; i++) { CGRect f = [pdfView frame]; [pdfView setFrame: f]; UIGraphicsBeginPDFPage(); CGContextRef currentContext = UIGraphicsGetCurrentContext(); CGContextTranslateCTM(currentContext, 72, 72); // Translate for 1" margins [[[pdfView subviews] lastObject] setContentOffset:CGPointMake(0, 648 * i) animated:NO]; [pdfView.layer renderInContext:currentContext]; } UIGraphicsEndPDFContext(); 而且我也尝试了下面这个链接,但是我不能添加uiwebview子视图来写pdf。 http://b2cloud.com.au/tutorial/drawing-over-a-pdf-in-ios-pdf-template/

以PDF格式生成表格

我想在PDF中创build一个表格,其中的数据来自我的iPhone应用程序。 我怎样才能做到这一点?

iOS上PDF文档的默认纸张大小和单位

要在iOS中创buildPDF文档,请在官方文档中( http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GeneratingPDF/GeneratingPDF.html#//apple_ref/doc/uid/TP40010156 -CH10-SW3 ),默认大小为612×792,比例为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(CGRectMake(0, 0, 612, 792), nil); 然而,国际标准IS0216的A4纸的默认尺寸为210x297mm,其纵横比为1.41429。 所以,我的问题是:苹果的标准是什么? 这个612×792尺寸与A4相同吗? 打印边距等是否包括在内?

将签名图像添加到pdf,而不在iOS中向用户显示pdf数据

我想添加现有的PDF签名。 我以下面的方式做了这个: 1)加载UIView现有的PDF说mainView。 2)在mainView上添加签名图像。 3)调用以下function -(NSMutableData *)getPDFDatafromUIView { DebugLog(@""); // Creates a mutable data object for updating with binary data, like a byte array NSMutableData *pdfData = [NSMutableData data]; // Points the pdf converter to the mutable data object and to the UIView to be converted UIGraphicsBeginPDFContextToData(pdfData, mainView.bounds, nil); UIGraphicsBeginPDFPage(); CGContextRef pdfContext = UIGraphicsGetCurrentContext(); // […]

有什么办法可以从iOs中的XML / HTML模板生成PDF文件

我正在创build一个iPad应用程序,因为我必须使用不同的PDF表单。 我有一些使用Quartz2D通过代码生成PDF文件的方法。 但是我必须通过代码编写完整的表单。 我将来可能需要更新PDF表单,所以我必须再次编写代码。 所以我听说有一个名为iTextSharp的组件.net pdf的创build – 有什么类似的iOS? 这样我可以使用一些XML模板来创buildPDF文件。 请帮忙,谢谢