Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
12 votes
2 answers
535 views

Application for converting markdown to PDF

First time writing C in a long time and would like some code review to try and improve my code. I have some specific questions, but first an introduction to the code. The application is a simple ...
Fredrik Wallgren's user avatar
11 votes
1 answer
2k views

Python script to extract text from PDF with images

I have the following Python script. The purpose of the script is to extract text from PDFs. I use textract for that because soon I realized there is no easy way to check if a page contains an image or ...
Iakovos Belonias's user avatar
11 votes
1 answer
419 views

Writing PDF files in C#

I have been making C# software to write PDF files. It's intended to be simple to use, compact, efficient and also reasonably simple to understand, maintain and extend as required. The basic ...
George Barwood's user avatar
10 votes
1 answer
1k views

Read and replace URL from PDF file

This is a code I wrote to find all URL within a PDF file and replace the one that matches the ID that I passed as a parameter. It works as intended, but as I am a beginner on Java, I am sure there ...
Teio's user avatar
  • 135
9 votes
2 answers
1k views

Encrypt PDF-Files

I wrote the following program for encrypting PDF Files for checking out the PyPDF2 module. It takes a path and a password via the command line or user input. Then all PDF files in the provided folder ...
Sandro4912's user avatar
  • 3,076
8 votes
1 answer
3k views

What can I improve on my iOS PDF class?

This is the first PDF class I have made for the iOS using code from Apple's samples. There could easily be stuff here wrong that I am missing. I intend this to get images out of for a layer, for ...
Jeffrey Drake's user avatar
8 votes
1 answer
311 views

LaTeX code for presentation slides

I'm giving a presentation in a few days. I'm preparing my material in LaTeX; however, I am relatively new to it. How can I make my LaTeX code more concise and less repetitive? Here is a reduced ...
JesseTG's user avatar
  • 459
7 votes
1 answer
2k views

Open encrypted PDF file by trying passwords from a word list

As an exercise, I wrote a program to decrypt a PDF file. The only thing that is known about the encryption password is that it is a single English word (all capital or lowercase). The program uses a ...
Sandro4912's user avatar
  • 3,076
7 votes
3 answers
864 views

Brute force search for pdf password in python

I forgot the password to my pdf. I remembered a few characters, so I made a simple password-cracker program in Python. Is the document lost now given the number of combinations? Out of curiosity, how ...
gabriel's user avatar
  • 71
7 votes
1 answer
114 views

Two versions of PDF-Selector

I have basically ended up with 2 versions of a PDF-Selector. Both versions do the same thing. I'm not sure which solution is better. Maybe someone could give me a code review. I use: PDFSharp-Nuget-...
Physics131's user avatar
7 votes
1 answer
2k views

Speeding up Python program that converts DOCX to PDF in Windows

This is meant to be a performance-centric question as this type of conversion is obviously very common. I'm wondering about the possibilities for making this process faster. I have a program that ...
rabbittas2739's user avatar
7 votes
2 answers
298 views

PDF merging program

I made a program that merges all the PDFs in a certain map. The program is made so it merges only one sided PDFs. I would like your opinion on the code and how can it be improved. ...
Murg's user avatar
  • 279
7 votes
3 answers
375 views

Improved RFC 1951 Deflate compression

I have substantially revised my earlier implementation, it now seems to be competitive with the standard C# ZLib implementation, increasing compression while being faster for moderate length inputs, ...
George Barwood's user avatar
6 votes
2 answers
693 views

Speed up search function for PDFs

This function takes a file path to a PDF file, and a search string(s). It spits out a count of the number of times the string(s) shows in the PDF. Any ideas how I can make it faster? It can be tested ...
Cam's user avatar
  • 235
6 votes
2 answers
9k views

Ghost4J PDF to image conversion

The primary goal of this code is to convert a PDF file to images. I also create a directory under C:/Media based on a combination of the PDF name and current date ...
Dan's user avatar
  • 163
6 votes
2 answers
1k views

Class to generate a pdf invoice

I am learning to work with OOP design patterns and so I challenged myself with the idea of creating a way to generate a pdf invoice based on some information entered. So, this is what I have done so ...
Anastacia's user avatar
6 votes
2 answers
3k views

A Python script to plot data and save to PDF

I have a very simple Python script. All it does is open two data files from a given directory, read the data, make a series of plots and save as PDF. It works, but it is very slow. It takes almost 20 ...
point618's user avatar
  • 113
6 votes
2 answers
804 views

Implementing a PDF generator that converts classes into PDFs

I'm building a tool that takes in web requests and deserializes JSON requests into a C# class. Each page calls a different controller URL that is looking for a specific request. Once the request is ...
JD Davis's user avatar
  • 163
6 votes
1 answer
256 views

Get bibtex entries from metadata of PDF files

When I have to write a report or an article, I usually have my bibliography as PDFs in a specific folder, so I wrote this script to automate the generation of bibtex entries. It works so far, but I'd ...
nicoco's user avatar
  • 389
6 votes
1 answer
333 views

PDF Script Tool - adds JavaScripts to PDF files

This is a Windows Forms application that adds JavaScripts to PDF files. It supports multiple files at the same time. Right now, the only supported script is a "time-stamp on print" script, but any ...
Michael Brandon Morris's user avatar
6 votes
1 answer
863 views

Dealing with a command line argument (path) with spaces

I created a key in Windows registry to have an option on every folder which allows me to simply right click, choose the right option and have a PDF made, either from JPGS, or PNGs, or TIFs. My ...
menteith's user avatar
  • 311
6 votes
1 answer
483 views

Spliting PDF and get thumbnail while adding it to a ListView

I'm doing a application to work with PDF and TIFF files. To divide them, the user opens the file or folder (if it is a folder, it gets all the files inside) and the app splits the file, getting a tiny ...
Sofia Rodrigues's user avatar
6 votes
1 answer
288 views

Makefile for building classwork from markdown files and LaTeX

The following makefile builds my classwork for my various college classes and builds pdfs to hold the notes I took during class. I would like feedback on my directory structure and any optimizations ...
HSchmale's user avatar
  • 895
5 votes
2 answers
1k views

Classifying image by file extension within a PDF creator

To create a pdfDocument I am using following code which works as expected but do not want to use multiple if else. Any patterns or any design strategies? It may ...
Simsons's user avatar
  • 723
5 votes
3 answers
628 views

PDF script tool to convert documents to PDF and add fields and scripts

This is an update from here. This tool is a Windows Form application that can add fields and scripts to PDF files, as well as convert Microsoft Office Word documents to PDF. The usage is as follows: ...
Michael Brandon Morris's user avatar
5 votes
3 answers
7k views

Searching for a string in a downloaded PDF

This code goes to the website containing the PDF, downloads the PDF, then it converts this PDF to text. Finally, it reads this whole file (Over 5000 lines) into a list, line by line, and searches for ...
Unknown's user avatar
  • 83
5 votes
2 answers
2k views

PDF page & word count, recursive searching of directory tree, output to excel

I wrote this program as part of a work-related problem but with a focus on improving my Python skills. The program was needed to do a word count PDF files. The problem was there were a large number of ...
Cam's user avatar
  • 235
5 votes
1 answer
118 views

ExcelVBA loop exports data from spreadsheet to table within Excel

I want to nest a for loop to cycle through the Range.Value but ("B4") throws me off and this can't be avoided. I was considering using an array to do this but can'...
MisterGT's user avatar
5 votes
1 answer
3k views

PDF processing by PDFBox app jar

I want to convert a large PDF file into individual text files with PDFBox using Python. This code takes lot of time to convert a PDF containing 1000 pages. Is there anything I can do to improve it? ...
Rahul Patel's user avatar
5 votes
2 answers
5k views

Finding matching PDF files in different folders and merging the two files into one

I have code which currently loops through one folder, finds two matching pdf-filenames and merges them into 1 pdf-file always in the same order. File 1 then File 2. My code is slow, maybe because ...
RHBerendsen's user avatar
5 votes
1 answer
944 views

Small program to download wikipedia articles to pdf

I made a small app to download wikipedia articles (and optionally those that it links to) as PDFs to take on the go. I'd eventually like to do a text-to-speech option and save the article as an mp3, ...
Matt's user avatar
  • 339
5 votes
1 answer
282 views

MySQL/CUPS PDF printer for STAR TSP100 ECO

This is my very first attempt at Python and whilst the script works perfectly, I'd like to see if I'm missing anything obvious or doing anything particularly stupid. I think this runs on Python 2.7, ...
NicholasC's user avatar
5 votes
0 answers
58 views

CMYK shadings implementation for PGF

PGF is a graphics framework for \$\TeX\$ and friends. It supports shadings (gradients), but only in RGB. There is often a need to output shadings in CMYK and I am having a go at implementing this. I'...
David Purton's user avatar
4 votes
5 answers
610 views

Class for generating PDF documents

Following is a chunk of code from my class which generates PDF documents. I am refactoring my code and in the process I have created short methods. But I have to pass 'table i.e PdfPTable' to my ...
Kashif's user avatar
  • 399
4 votes
2 answers
6k views

Searching through various PDF files

I'm just looking for advice on how I can get my code to operate faster. It's pretty quick right now with searching through 30 3-page PDFs, but I imagine once there gets to be thousands of files to ...
Christopher Bruce's user avatar
4 votes
2 answers
9k views

Python3 - Determing if a PDF is scanned or "searchable"

I am in a situation where I need to determine if a PDF file is either: Scanned Searchable (contain text) To do this, I am simply running the command pdffonts on ...
oliverbj's user avatar
  • 257
4 votes
2 answers
318 views

Attempting an OOP approach for PDF Paranoia - Automate the Boring Stuff CH 15

This exercise is called PDF Paranoia and it comes from CH 15 of the book Automate the Boring Stuff With Python - second edition. There are two parts to the exercise, which I've separated into two ...
Ramza's user avatar
  • 171
4 votes
2 answers
4k views

Python code to encrypt and email PDF file using PyPDF2

This is my first programming project with real world application. It's purpose is to take a file from a directory, encrypt it with a predetermined password, and email to appropriate recipient. ID ...
AlliDeacon's user avatar
4 votes
3 answers
1k views

Converting Pandoc Markdown images from captioned to inline

After writing a rather long document in Markdown and using pandoc to convert it to a PDF, I found, to my dismay, that many of the images were out of place, and that they all had their alternate text ...
Sam Estep's user avatar
  • 1,767
4 votes
2 answers
4k views

Extract Pages from PDF based on search in python

Everything is working fine except timing. it takes lot time for my file containing 1000 pages and having 100 pages of interest. ...
Rahul Patel's user avatar
4 votes
1 answer
153 views

PDF conversion and time stamp tool

This is the latest edition of my PDF tool, previously mentioned here, here, here, and inspired by my first attempt at a MVP here. Major differences from previous editions: It uses the MVP pattern (...
Michael Brandon Morris's user avatar
4 votes
1 answer
129 views

Shell script to download Project Euler problems and combine to PDF

This is a script I created that downloads Project Euler webpages and combines them to PDF. The script also downloads animated files. ...
qwr's user avatar
  • 1,055
4 votes
1 answer
3k views

Decrypting PDF-Files

In Encrypt PDF-Files I provided a Python program to encrypt PDF-Files in a folder. This program here does the oposite. Giving a password and path all PDFs which are encrypted are decrypted in the ...
Sandro4912's user avatar
  • 3,076
4 votes
1 answer
902 views

pdftk replacement

I am working on a replacement for a program called pdftk. The program needs to be able to take pdf's, and generate fdf files for them, fill a pdf from an fdf, output info about the forms, and output ...
Oscar Smith's user avatar
  • 3,597
4 votes
1 answer
1k views

Merging SharePoint Word documents into a single PDF with iTextSharp

I created a program which collects all the word files from a folder which belongs to our SharePoint library of documents. The program will only grab the documents if they were submitted/are a part of ...
Bassie's user avatar
  • 559
4 votes
2 answers
182 views

Unstructured to Structured TOC

The following code tries to convert an unstructured TOC with bounding box layout data given by the output of pdftotext -bbox-layout -f 11 -l 13 new_book.pdf toc.html...
Sati's user avatar
  • 417
4 votes
1 answer
290 views

Copy data from a pdf into word for the purpose of starting a report

In order to write some reports I have to manually copy the name of client, address, claim number, etc from a pdf that I receive. I want to automate this part of the report writing by using vba to copy ...
joniponi's user avatar
4 votes
1 answer
13k views

Removing a header and footer from text output with PDFminer

I use PDFminer to extract text from a PDF, then I reopen the output file to remove an 8 line header and 8 line footer. Is there a more efficient way to remove the header/footer, either in place or ...
plieb's user avatar
  • 81
4 votes
0 answers
111 views

Download and analyze PDFs of Congressional records

This is built with Python 2.7.15. The goal of this script is to count the number of words spoken by each Senator on the floor of Congress between given dates. It pulls from the Congressional Record, ...
Sebastian's user avatar
  • 141
3 votes
2 answers
468 views

Changing PDF annotation with JavaScript code to jump to page into regular to Go To Page action

I have just written my first program in C#. Please explain: Have I used any bad practices? How could the code be improved? I would appreciate if provide the ...
menteith's user avatar
  • 311