Questions tagged [pdf]

Portable Document Format (PDF) is an open standard for electronic document exchange maintained by the International Organization for Standardization (ISO). Questions can be about creating, reading, editing PDFs using different languages.

Filter by
Sorted by
Tagged with
1721 votes
30 answers
955k views

How Can I add HTML And CSS Into PDF [closed]

I have an HTML (not XHTML) document that renders fine in Firefox 3 and IE 7. It uses fairly basic CSS to style it and renders fine in HTML. I'm now after a way of converting it to PDF. I have tried:...
1509 votes
23 answers
1.1m views

Merge / convert multiple PDF files into one PDF [closed]

How could I merge / convert multiple PDF files into one large PDF file? I tried the following, but the content of the target file was not as expected: convert file1.pdf file2.pdf merged.pdf I need ...
alcohol's user avatar
  • 22.7k
1466 votes
3 answers
1.1m views

Proper MIME media type for PDF files

When working with PDFs, I've run across the MIME types application/pdf and application/x-pdf among others. Is there a difference between these two types, and if so what is it? Is one preferred over ...
friedo's user avatar
  • 65.8k
1365 votes
29 answers
1.8m views

Recommended way to embed PDF in HTML?

What is the recommended way to embed PDF in HTML? iFrame? Object? Embed? What does Adobe say itself about it? In my case, the PDF is generated on the fly, so it can't be uploaded to a third-party ...
Daniel Silveira's user avatar
773 votes
14 answers
349k views

ImageMagick security policy 'PDF' blocking conversion

The Imagemagick security policy seems to be not allowing me perform this conversion from pdf to png. Converting other extensions seem to be working, just not from pdf. I haven't changed any of the ...
T. Zack Crawford's user avatar
685 votes
6 answers
1.0m views

Inserting a PDF file in LaTeX

I am trying to insert a PDF or doc file as an appendix in my LaTeX file. Do you know how I can do this?
Guido's user avatar
  • 6,893
507 votes
26 answers
861k views

Convert HTML to PDF in .NET [closed]

I want to generate a PDF by passing HTML contents to a function. I have made use of iTextSharp for this but it does not perform well when it encounters tables and the layout just gets messy. Is there ...
user avatar
417 votes
13 answers
448k views

Python module for converting PDF to text [closed]

Is there any python module to convert PDF files into text? I tried one piece of code found in Activestate which uses pypdf but the text generated had no space between and was of no use.
cnu's user avatar
  • 36.2k
416 votes
24 answers
465k views

Convert PDF to image with high resolution

I'm trying to use the command line program convert to take a PDF into an image (JPEG or PNG). Here is one of the PDFs that I'm trying to convert. I want the program to trim off the excess white-...
JBWhitmore's user avatar
  • 11.6k
378 votes
3 answers
104k views

Fast and Lean PDF Viewer for iPhone / iPad / iOS - tips and hints?

There has been many Questions recently about drawing PDF's. Yes, you can render PDF's very easily with a UIWebView but this cant give the performance and functionality that you would expect from a ...
350 votes
34 answers
703k views

How to extract text from a PDF file?

I'm trying to extract the text included in this PDF file using Python. I'm using the PyPDF2 package (version 1.27.2), and have the following script: import PyPDF2 with open("sample.pdf", &...
Simplicity's user avatar
  • 47.5k
317 votes
7 answers
540k views

Generating PDF files with JavaScript

I’m trying to convert XML data into PDF files from a web page and I was hoping I could do this entirely within JavaScript. I need to be able to draw text, images and simple shapes. I would love to be ...
amoeba's user avatar
  • 4,015
301 votes
14 answers
461k views

How do I force files to open in the browser instead of downloading (PDF)?

Is there a way to force PDF files to open in the browser when the option "Display PDF in browser" is unchecked? I tried using the embed tag and an iframe, but it only works when that option is ...
elloalisboa's user avatar
  • 3,083
295 votes
17 answers
1.0m views

How to display PDF file in HTML?

I have an auto generated PDF file by itext and I need to display that PDF file in HTML. My question is: How to display a local PDF file in HTML using pdf.js? Should that PDF file be generated by some ...
vivek's user avatar
  • 4,599
293 votes
2 answers
184k views

How can I convert a series of images to a PDF from the command line on Linux? [closed]

I have a scanning server I wrote in CGI and Bash. I want to be able to convert a bunch of images (all in one folder) to a PDF from the command line. How can that be done?
Jakob Weisblat's user avatar
289 votes
15 answers
135k views

How to search contents of multiple pdf files?

How could I search the contents of PDF files in a directory/subdirectory? I am looking for some command line tools. It seems that grep can't search PDF files.
Jestin Joy's user avatar
  • 3,731
271 votes
15 answers
312k views

Merge PDF files

Is it possible, using Python, to merge separate PDF files? Assuming so, I need to extend this a little further. I am hoping to loop through folders in a directory and repeat this procedure. And I may ...
Btibert3's user avatar
  • 39k
243 votes
8 answers
672k views

Is it possible to embed animated GIFs in PDFs? [closed]

Is it possible to embed animated GIFs in PDFs? And how might I go about such a thing? are there any dangers I should be aware of? For some more details on why I think it's a good thing and how it ...
Joe's user avatar
  • 4,377
235 votes
8 answers
395k views

How do I convert Word files to PDF programmatically? [closed]

I have found several open-source/freeware programs that allow you to convert .doc files to .pdf files, but they're all of the application/printer driver variety, with no SDK attached. I have found ...
Shaul Behr's user avatar
228 votes
11 answers
293k views

How to render a PDF file in Android

Android does not have PDF support in its libraries. Is there any way to render PDF files in the Android applications?
alexleutgoeb's user avatar
  • 3,123
219 votes
17 answers
323k views

How to get rid of blank pages in PDF exported from SSRS

I have a two-page SSRS report. When I exported it to PDF it was taking 4 pages due to its width, where the 2nd and 4th pages were displaying one of my fields from the table. I tried to set the layout ...
user avatar
219 votes
10 answers
311k views

How do I convert a PDF document to a preview image in PHP? [closed]

What libraries, extensions etc. would be required to render a portion of a PDF document to an image file? Most PHP PDF libraries that I have found center around creating PDF documents, but is there a ...
Mathew Byrne's user avatar
  • 3,713
210 votes
19 answers
464k views

Force to open "Save As..." popup open at text link click for PDF in HTML

I have some big size PDF catalogs at my website, and I need to link these as download. When I googled, I found such a thing noted below. It should open the "Save As..." popup at link click... <...
designer-trying-coding's user avatar
197 votes
6 answers
235k views

<embed> vs. <object>

Which is the right/best tag to use in my HTML file when I want to display the Adobe PDF viewer? Right now I'm using the code below, but there are weird side effects (e.g. it seems to steal the ...
JayhawksFan93's user avatar
195 votes
8 answers
349k views

How can I extract embedded fonts from a PDF as valid font files?

I'm aware of the pdftk.exe utility that can indicate which fonts are used by a PDF, and wether they are embedded or not. Now the problem: given I had PDF files with embedded fonts -- how can I ...
user avatar
187 votes
15 answers
301k views

How to extract text from a PDF? [closed]

Can anyone recommend a library/API for extracting the text and images from a PDF? We need to be able to get at text that is contained in pre-known regions of the document, so the API will need to give ...
Budda007's user avatar
  • 1,903
185 votes
10 answers
292k views

How to convert a Markdown file to PDF

I have a Markdown file that I wish to convert to PDF so that I can upload it on Speakerdeck. I am using Pandoc to convert from markdown to PDF. My problem is I can't specify what content should go on ...
Akshar Raaj's user avatar
  • 14.3k
185 votes
10 answers
57k views

What is the smallest possible valid PDF?

Out of simple curiosity, having seen the smallest GIF, what is the smallest possible valid PDF file?
meshy's user avatar
  • 8,500
181 votes
17 answers
323k views

Extract a page from a pdf as a jpeg

In python code, how can I efficiently save a certain page of a PDF as a JPEG file? Use case: I have a Python flask web server where PDFs will be uploaded and JPEGs corresponding to each page are ...
vishvAs vAsuki's user avatar
170 votes
11 answers
42k views

PDFtk Server on OS X 10.11

I've been using PDFTK Server on OSX pre 10.11 for over a year without any issues running commands on the command line. After installing OSX 10.11 beta, I can no longer run any PDFTK Server commands ...
Aaron's user avatar
  • 3,068
164 votes
9 answers
189k views

Add text to Existing PDF using Python

I need to add some extra text to an existing PDF using Python, what is the best way to go about this and what extra modules will I need to install. Note: Ideally I would like to be able to run this on ...
Frozenskys's user avatar
  • 4,310
158 votes
8 answers
227k views

How to create PDFs in an Android app? [closed]

Is there any way to create PDF Files from an Android application?
user avatar
156 votes
14 answers
449k views

How to create PDF files in Python [closed]

I'm working on a project which takes some images from user and then creates a PDF file which contains all of these images. Is there any way or any tool to do this in Python? E.g. to create a PDF file ...
Stephen T.'s user avatar
  • 1,883
148 votes
14 answers
785k views

How to make PDF file downloadable in HTML link?

I am giving link of a pdf file on my web page for download, like below <a href="myfile.pdf">Download Brochure</a> The problem is when user clicks on this link then If the user have ...
djmzfKnm's user avatar
  • 26.7k
140 votes
8 answers
248k views

Converting HTML files to PDF [closed]

I need to automatically generate a PDF file from an exisiting (X)HTML-document. The input files (reports) use a rather simple, table-based layout, so support for really fancy JavaScript/CSS stuff is ...
panschk's user avatar
  • 3,228
138 votes
10 answers
183k views

How can I visually inspect the structure of a PDF to reverse engineer it? [closed]

How can I inspect the structure of PDF files? Use case: I'm trying to programmatically generate PDF files (using iText). I'm having trouble achieving certain layouts, but I have PDF files with text ...
bmm6o's user avatar
  • 6,197
136 votes
12 answers
265k views

How can I display a pdf document into a Webview?

I want to display pdf contents on webview. Here is my code: WebView webview = new WebView(this); setContentView(webview); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl("http://...
shriya's user avatar
  • 1,385
135 votes
11 answers
248k views

How to return PDF to browser in MVC?

I have this demo code for iTextSharp Document document = new Document(); try { PdfWriter.GetInstance(document, new FileStream("Chap0101.pdf", FileMode.Create)); document....
Tony Borf's user avatar
  • 4,579
134 votes
10 answers
308k views

How to convert webpage into PDF by using Python

I was finding solution to print webpage into local file PDF, using Python. one of the good solution is to use Qt, found here, https://bharatikunal.wordpress.com/2010/01/. It didn't work at the ...
Mark K's user avatar
  • 8,789
132 votes
6 answers
134k views

Duplicate headers received from server

Duplicate headers received from server The response from the server contained duplicate headers. This problem is generally the result of a misconfigured website or proxy. Only the website or proxy ...
Purvesh Desai's user avatar
132 votes
4 answers
100k views

How to find out which fonts are referenced and which are embedded in a PDF document

We have a little problem with fonts in PDF documents. In order to put the finger on the problem I'd like to inspect, which fonts are actually embedded in the pdf document and which are only referenced....
Jens Schauder's user avatar
131 votes
10 answers
135k views

Render HTML to PDF in Django site

For my django powered site, I am looking for an easy solution to convert dynamic html pages to pdf. Pages include HTML and charts from Google visualization API (which is javascript based, yet ...
user avatar
130 votes
22 answers
221k views

Create PDF from a list of images

Is there any practical way to create a PDF from a list of images files, using Python? In Perl I know that module. With it I can create a PDF in just 3 lines: use PDF::FromImage; ... my $pdf = PDF::...
macabeus's user avatar
  • 4,186
129 votes
12 answers
243k views

How to display a PDF via Android web browser without "downloading" first

Is there a way to get the stock Android browser to auto-open a PDF, Word or other typical file without having to go through the process of downloading the file and then getting the user to open the ...
Chris Saldanha's user avatar
128 votes
9 answers
165k views

Convert PDF to clean SVG? [closed]

I'm attempting to convert a PDF to SVG. However, the one I am using currently maps a path for every letter in every piece of text, meaning if I change the text in its source file, it looks ugly. I ...
DanRedux's user avatar
  • 9,139
126 votes
6 answers
238k views

Show a PDF files in users browser via PHP/Perl

I want to show my users PDF files. The reason why I use CGI to show the PDF is I want to track the clicks for the PDF, and cloak the real location of the saved PDF. I've been searching on the Internet ...
dimassony's user avatar
  • 1,287
125 votes
4 answers
61k views

Merging png images into one pdf file [closed]

How can I merge several .png files into one PDF file in Unix?
twidizle's user avatar
  • 1,505
125 votes
20 answers
297k views

IPython/Jupyter Problems saving notebook as PDF

So, I've been trying to save a jupyter notebook as PDF but I just can't figure out how to do this. The first thing I try is from the file menu just download as PDF, but doing that results in: ...
Isak Baizley's user avatar
  • 1,732
121 votes
11 answers
425k views

Print PDF directly from JavaScript

I am building a list of PDFs in HTML. In the list I'd like to include a download link and a print button/link. Is there some way to directly open the Print dialog for the PDF without the user seeing ...
Craig Celeste's user avatar
121 votes
4 answers
160k views

Convert PDF to PNG using ImageMagick

using ImageMagick, what command should i use to convert a PDF to PNG? I need highest quality, smallest file size. this is what I have so far (very slow by the way): convert -density 300 -depth 8 -...
StackOverflowNewbie's user avatar

1
2 3 4 5
1023