pdf-generation

How do I convert a PDF file to HTML in PHP?

坚强是说给别人听的谎言 提交于 2019-11-28 10:49:07
问题 How do I convert a PDF file to HTML in PHP? Is there any lib or web service? I mean free, thanks! 回答1: Google pdf2html, pdftohtml looks to be the only viable one. and it's based on a command line program, not PHP. so it may not be useful to you. Google is capable of converting, so there may be a way to do it with GDocs as well. though I'm not sure of that. At any rate, I hope this gets you on the proper path at least. 回答2: I've tried Poppler's pdftohtml command to convert PDF files to HTML

Skip adding empty tables to PDF when parsing XHTML using ITextSharp

て烟熏妆下的殇ゞ 提交于 2019-11-28 10:43:23
问题 ITextSharp throws an error when you attempt to create a PdfTable with 0 columns. I have a requirement to take XHTML that is generated using an XSLT transformation and generate a PDF from it. Currently I am using ITextSharp to do so. The problem that I am having is the XHTML that is generated sometimes contains tables with 0 rows, so when ITextSharp attempts to parse them into a table it throws and error saying there are 0 columns in the table. The reason it says 0 columns is because

convert windows form to pdf file

别来无恙 提交于 2019-11-28 10:43:15
问题 how could i convert windows form into pdf(pdf document) format with same design as on form 回答1: I tested this and it works. I don't like the fact that it creates a temp file. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing.Imaging; using System.Drawing.Printing; using System.IO; namespace WindowsFormsApplication4 { public partial class

ABCPDF not showing full table data

旧城冷巷雨未停 提交于 2019-11-28 10:36:33
问题 Please refer to the image below: It's cutting off some of the table data because of the width. My table width is more than 1000 px. I know The default document size for ABCpdf is 612 by 792. Using the code below to set document width and height double w = doc.MediaBox.Width; double h = doc.MediaBox.Height; double l = doc.MediaBox.Left; double b = doc.MediaBox.Bottom; doc.Transform.Rotate(90, l, b); doc.Transform.Translate(w, 0); doc.Rect.Width = h; doc.Rect.Height = w; I want to display all

Google Spreadsheet to pdf with watermark in Google script

筅森魡賤 提交于 2019-11-28 10:23:18
问题 I want to convert the spreadsheet with a watermark/background image, and send + save the generated pdf The converting to pdf worked, but I don't know if/how you can put an image to the generated pdf. This is what i got now: function ExportAndSent(subject, filename, email) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var message = "A message"; var tempSpreadsheet = SpreadsheetApp.create(filename); var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); sheet = ss

Including links within Rmarkdown tables (pdf)

一世执手 提交于 2019-11-28 10:23:18
I am trying to include links to particular webpages in a 'kable' table in Rmarkdown, when creating a pdf. The table has 4 columns, and I wish for the links to be in the second column, which currently includes strings. The output of the table is given below; knitr::kable(ind_rank_table_final,row.names = FALSE,caption = "Industry Rank",align = rep("l",ncol(ind_rank_table))) Ben Using paste0 , you can construct markdown-formatted URLs in your dataframe, and then pass that to kable , like so: --- output: pdf_document --- ```{r} # some urls urls <- rep("https://stackoverflow.com/", 10) # use paste0

Add print area content (appending) at the end of initial existed pdf file in a new page section

删除回忆录丶 提交于 2019-11-28 09:37:36
问题 For generating a report, I have create pdf with bellow approach. ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ fileName:=ThisWorkbook.path & "\rep.pdf", _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False In the ActiveSheet, there were specified Print Area, Witch contains a Table, so table's column filtered value have change programmatically, and need: I want new face of the print area that reforms by changing filtering

Convert doc to pdf using Apache POI

爱⌒轻易说出口 提交于 2019-11-28 09:28:46
I am trying to convert doc to pdf using Apache POI, but the resulting pdf document contains only text, it is not having any formating like images, tables alignment etc. How can I convert doc to pdf with having all formattings like tables, images, alignments? Here is my code: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStream; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.Paragraph; import com.lowagie.text.pdf.PdfWriter; import org.apache.poi.hwpf.HWPFDocument; import org.apache

iText 5 header and footer

瘦欲@ 提交于 2019-11-28 08:42:51
问题 how I can add in my PDF page the header and the footer ? I wanna a table with 3 column in header and other table, 3 column in the footer. My page could be A3 or A4, and landscape or portrait. Can anyone help me? I can not found on internet good examples. Thanks! Tommaso 回答1: Create a class MyPageEventListener that extends PdfPageEventHelper Add a page event listener to the PdfWriter object In the onEndPage method of MyPageEventListener class, put the code for header/footer Example: public

How to repair a PDF file and embed missing fonts

吃可爱长大的小学妹 提交于 2019-11-28 08:27:28
I use pdftk to repair some failures in corrupted PDF files, but I faced another problem which is not fixed by pdftk (or at least I do not know how to do so). I have PDF files with text based on TrueType fonts, but the fonts have not been embedded during PDF creation. Now I want to embed the required fonts to the existing files. Is there a command-line tool (like pdftk ) to embed missing fonts by providing path to TTF files? Kurt Pfeifle You can use Ghostscript to embed missing fonts. Run the command like this: gs \ -o file-with-embedded-fonts.pdf \ -sDEVICE=pdfwrite \ -dEmbedAllFonts=true \