pdf-generation

Create PDF / Word (Doc) file within app

那年仲夏 提交于 2019-11-30 03:22:56
问题 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

Keep table in one piece MigraDoc / PDFsharp

♀尐吖头ヾ 提交于 2019-11-30 03:19:54
I am using PDFsharp / MigraDoc to write tables and charts to PDF files. This worked great so far, however MigraDoc will always split my tables (vertically) when it should move the whole table to the next page in the document. How do I make sure the table will stay in one piece? Table class of MigraDoc.DocumentObjectModel.Tables has a bool KeepTogether property however it seems to have no effect (either set to true or false). Is there a way to do it manually? Is there any way to "measure" the distance from the end of the page and compare it to tables height? (Or any other way of knowing wether

How to convert iTextPDF Document to Byte Array

ぃ、小莉子 提交于 2019-11-30 03:18:52
问题 I need to convert iTextPDF Document file to byte[] after it's created in memory . I have already tested that I've no problem with creating PDF properly. The problem is how to convert it to byte array to store in DB. Here's my code: Document generatedDocument = reportService.generateRequestForm(scdUser, jsonObject, 0, null); reportService.generateRequestForm(scdUser, jsonObject, 0, null); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter pdfWriter = PdfWriter.getInstance

Rails 3 -Render PDF from view and attach to email

我只是一个虾纸丫 提交于 2019-11-30 03:12:34
I have been using Wicked_pdf to render a view as a PDF and actionmailer to send emails, but I can't get them to work together. I want to attach a PDF version of a certain view to an email using actionmailer and send it out by clicking a link or a button. I have a link_to command that sends out an email. Here is my controller that gets the email generated: def sendemail @user = User.find(params[:id]) Sendpdf.send_report(@user).deliver redirect_to user_path(@user) flash[:notice] = 'Email has been sent!' end Here is what I have in my actionmailer: class Sendpdf < ActionMailer::Base default :from

Programmatically convert Word (docx) to PDF

和自甴很熟 提交于 2019-11-30 02:44:53
Ok before you think "Not another question like this" please read this first. I have an application (web application in ASP.NET MVC 3) the generates Word files in DocX using the DocX library . The application takes a template and fills it in with all the data from a database. Now I want to create a PDF version of that created docx-file. I know apose.word is an option, but not for me since I have little budget. Other libs where I have to spend some money on are also out of the question. I don't have a sharepoint server so Word Automation Services isn't an option either. So I have 2 options (that

Why is there a left and top padding in a cell using TCPDF in php?

谁说我不能喝 提交于 2019-11-30 02:43:30
问题 I am printing a cell using the TCPDF(http://www.tcdf.org/) class in php. The cell should be placed into the top left corner. Everything works great, except that a left and top padding is added inside the cell. Here is my code: require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetMargins(0,0,0); $pdf->SetAutoPageBreak(0,0); $pdf->SetFont('dejavusans', '', 8.5, '', true); $pdf-

Scale HTML proportionally to fit exactly to PDF A4 size

隐身守侯 提交于 2019-11-30 02:28:22
I am using PHP, Mysql, jQuery. I have a webpage that is to be converted into high-res A4 size PDF: http://optisolbusiness.com/funeral_site/sample/index/id/255 . I have converted the HTML to PDF using wkhtmltopdf , which works great. Here is the generated PDF http://optisolbusiness.com/Guru/Gurupdf/optisol.pdf . But the HTML is not fitting exactly to PDF size; There are spaces around the HTML in PDF. How to scale HTML to fit A4 PDF size 100%? Importantly the content inside the html (ie) text size, images width and height, background images also to be scaled proportionally. Your background image

How do you combine PDFs in ruby?

此生再无相见时 提交于 2019-11-30 02:26:58
This was asked in 2008 . Hopefully there's a better answer now. How can you combine PDFs in ruby? I'm using the pdf-stamper gem to fill out a form in a PDF. I'd like to take n PDFs, fill out a form in each of them, and save the result as an n -page document. Can you do this with a native library like prawn? Can you do this with rjb and iText? pdf-stamper is a wrapper on iText. I'd like to avoid using two libraries (i.e. pdftk and iText), if possible. As of 2013 you can use Prawn to merge pdfs. Gist: https://gist.github.com/4512859 class PdfMerger def merge(pdf_paths, destination) first_pdf

How to do mail merge on top of a PDF?

两盒软妹~` 提交于 2019-11-30 02:09:05
I often get a PDF from our designer (built in Adobe InDesign) which is supposed to be sent out to thousands of people. I've got the list with all the people, and it's easy doing a mail merge in OpenOffice.org. However, OpenOffice.org doesn't support the advanced PDF. I just want to output some text onto each page and print it out. Here's how I do it now: print out 6.000 copies of the PDF, then put all of them into the printer again and just print out name, address and other information on top of it. But that's expensive. Sadly, I can't make the PDF to an image and use that in OpenOffice.org

SVG to PDF on a shared linux server

て烟熏妆下的殇ゞ 提交于 2019-11-30 02:05:25
I have a website which uses SVG for an interactive client side thingamabob. I would like to provide the option to download a PDF of the finished output. I can pass the final SVG output back to the server, where I want to convert to PDF, then return it to the client for download. This would need to work on a headless shared linux server, where installation or compilation is either an enormous pain, or impossible. The website is PHP, so the ideal solution would be PHP, or use software that's easily installed on a shared webserver. Python, perl and ruby are available, along with the usual things