pdf-generation

How to create pdf file with mysql data?

老子叫甜甜 提交于 2019-11-30 22:08:23
问题 Can anyone give me simple example, how to create pdf file with mysql data? Im using fpdf http://www.fpdf.org/ for pdf creation. I want to print these data: $result = mysql_query("SELECT Name, Profesion, Email FROM customers") or die(mysql_error()); if(mysql_num_rows($result) > 0) { while($row = mysql_fetch_assoc($result)) { echo ' <td width="200px">'.$row['Name'].'</td> <td width="200px">'.$row['Profesion'].'</td> <td> width="200px">'.$row['Email'].'</td>'; } } 回答1: Have you looked at the

Difference between “Compile PDF” and knit2pdf

孤人 提交于 2019-11-30 21:35:07
I have a .Rnw file that I am able to compile into a PDF using the "Compile PDF" button in RStudio (or Command+Shift+k). However, when I use knit2pdf the graphics are not created and the complete PDF is not created. Why would this happen? How do you specifically set where the images will be stored so that pdflatex can find them? Here is an example. I am aware that this question that I posted a few days ago has a similar example, but in my mind these are two different questions. This file will run just fine and produce a PDF if I hit "Compile". I don't get any errors, the figure is produced in

iTextSharp - how to open/read/extract a file attachment?

荒凉一梦 提交于 2019-11-30 20:06:40
问题 I have some PDF's all with two attached files with static names. I would like to use iTextSharp to extract these files to a temp directory so that I can work with them further. I tried following the tutorial here but I ran into problems when the iTextSharp.text.pdf.PdfReader didn't have a getCatalog() method as shown in the bottom example. Any advice on how I can extract the attachments? Let's just say for ease that the PDF document is at "C:\test.pdf" and the two attachments are stored as

fpdf page break issue

与世无争的帅哥 提交于 2019-11-30 19:44:32
I have this loop that prints 6 rows (multicell) for about 30 times. The issue is that when it reaches the bottom page it prints 2 or 3 rows from the multicell and on the next page it prints the other 3 rows. I want to make it print all 6 rows on the next page if there is not enough space for all 6 rows on the present page. I use this code: $height_of_cell = 60; mm $page_height = 279.4; // mm (portrait letter) $bottom_margin = 20; // mm $space_left = $page_height - $p->GetY(); // space left on page $space_left -= $bottom_margin; // less the bottom margin if ( $height_of_cell >= $space_left) {

CSS styles not being applied to PDF with iTextSharp

只愿长相守 提交于 2019-11-30 19:39:56
I am attempting to convert a portion of my webpage to pdf using iTextSharp, and while the pdf generation is working correctly, none of the css styles are being applied. I've tried applying the styles one at a time, but that doesn't seem to work. This is what I've come up with so far: //Get the portion of the page to convert. StringBuilder sb = new StringBuilder(); print_div.RenderControl(new HtmlTextWriter(new StringWriter(sb))); string html = sb.ToString(); //Generate a random filename to use for the pdf Guid random_guid; random_guid = Guid.NewGuid(); string fileName = random_guid.ToString()

How do you make a table like this with FPDF using PHP?

白昼怎懂夜的黑 提交于 2019-11-30 19:13:28
How do you make a table like this with FPDF using PHP? I can't seem to figure out how to do this with $this->Cell . FPDF does not recognize rowspan or colspan . Here is a workaround that you can try, using empty cells and the border attribute for Cell . $pdf->Cell(40,5,' ','LTR',0,'L',0); // empty cell with left,top, and right borders $pdf->Cell(50,5,'Words Here',1,0,'L',0); $pdf->Cell(50,5,'Words Here',1,0,'L',0); $pdf->Cell(40,5,'Words Here','LR',1,'C',0); // cell with left and right borders $pdf->Cell(50,5,'[ x ] abc',1,0,'L',0); $pdf->Cell(50,5,'[ x ] checkbox1',1,0,'L',0); $pdf->Cell(40,5

Custom pdf viewer in android

Deadly 提交于 2019-11-30 18:49:40
问题 I need to have a custom pdf viewer inside my application where i have my own menu and all. It is not working with webview and i tried by converting each page into image but i feel its not a good way and it make my application big and complex. Is there any way to create custom pdf view in suggest me some link and tutorial Thanks 回答1: You obviously need a pdf renderer/viewer. Since core Android OS does not provide one you will need a 3rd party one. Take a look at http://andpdf.sourceforge.net/

Create PDF / Word (Doc) file within app

ぃ、小莉子 提交于 2019-11-30 18:31:11
Is there a definitive method of creating either a PDF or a MS Word Doc file within the app and email it immediately (and possibly, also store it). I have been trying for quite some time and have found out the JAVA libraries: apwlibrary and iText. But both of them dont provide any tutorials of sorts. Could anyone point me in the right direction? EDIT: Come to think of it, is could an online PDF generator be used, first by sending the data to the service, then retrieve the result and save it on the phone? I would recommend apache fop http://xmlgraphics.apache.org/fop/ you can use standard FOP to

Word wrap for Emacs print buffer to PDF

泄露秘密 提交于 2019-11-30 18:25:19
问题 I use this function for printing a buffer's content to PDF (from my .emacs file:) (defun print-to-pdf () (interactive) (ps-spool-buffer-with-faces) (switch-to-buffer "*PostScript*") (write-file "/tmp/tmp.ps") (kill-buffer "tmp.ps") (setq cmd (concat "ps2pdf14 /tmp/tmp.ps /home/user/" (buffer-name) ".pdf")) (shell-command cmd) (shell-command "rm /tmp/tmp.ps") (message (concat "Saved to: /home/user/" (buffer-name) ".pdf")) ) I cannot, however, find a way to enable or apply the visual-line minor

ITextPdf: Printing Arabic strings from Right To Left (RTL)

蓝咒 提交于 2019-11-30 18:23:39
问题 I use iTextpdf on java in order to generate stamped PDFs, sometimes the generated PDF is in Arabic and I am facing a funny problem. To let the Arabic page being created from Right To Left (RTL) I use tables and cells which have the property PdfPCell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL) . When I use this property Arabic does not show at all, if I avoid the call to this property Arabic strings are correctly showed, this means I shouldn't have problems with fonts and I don't really know