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
-3
votes
0answers
29 views

pdf to text in Winpython [closed]

Could someone please point out the noob error being made in the following code to read text from PDF? [Just in case, portable WinPython needs to be used on Windoze without local admin rights.] The ...
2
votes
2answers
142 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 ...
6
votes
2answers
109 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 ...
1
vote
0answers
24 views

Python3 - Cropping PDF files according to coordinates

I have a python script, that is performing OCR on PDF pages. I am trying to do so I can provide coordinates to the script - so it will only select the text within the provided coordinates ...
3
votes
1answer
55 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 ...
11
votes
1answer
1k 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 ...
5
votes
0answers
148 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 ...
3
votes
0answers
46 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, ...
4
votes
0answers
81 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 ...
6
votes
3answers
121 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, ...
0
votes
0answers
37 views

Class to create and send a PDF form with attached documents

I'm currently working on building a class to create a PDF form application with attached documents and sending that file to an endpoint in Box Api. I have found extremely difficult managing ...
6
votes
1answer
179 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 ...
7
votes
1answer
1k 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 ...
4
votes
1answer
649 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 ...
9
votes
2answers
334 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 ...
5
votes
0answers
39 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'...
1
vote
1answer
52 views

Text extraction of document files

I have this script that pulls text out of .docx, .doc and .pdf files and uploads that text to an Azure SQL Server. This is so users can search on the contents of those documents without using Windows ...
6
votes
1answer
99 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-...
0
votes
2answers
292 views

VB.NET - Error Handling in Generic Class for PDF Merge

As a part of a project I'm working on, a new requirement has arisen for me to be able to generate multiple PDF files and then merge them together before they are delivered to our client(s). For this, ...
3
votes
1answer
164 views

Retrieve TOC from PDF

I am reading 'Python Trick' in PDF type. To have a big picture of the book, I aim to get a structure dict of TOC from the book. So I copied its TOC from PDF to typora(a markdown editor) and solve the ...
2
votes
2answers
572 views

Extract images from a PDF or ZIP file

Input inputBlob - A PDF or ZIP file containing all the pages of many students' test papers. extension - The file type ("pdf" or ...
2
votes
1answer
211 views

Bash - script to encrypt pdf files using pdfencrypt

I wrote a small script to get around the issue when using pdfencrypt on the command line the password is always echoed as well as being saved to the 'history'. <...
1
vote
2answers
125 views

Exporting Matlab Figures as PDF with a Minimal Amount of Whitespace for use in LaTeX

About this code This Matlab function takes in the handle of a figure and exports a PDF containing a vector image of the plot. The caller of this function can opt to even remove the axes if he or ...
4
votes
1answer
320 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, ...
2
votes
1answer
235 views

Batch convert images to PDF

I wrote a simple program that converts graphic files in a folder to a single PDF using Magic.NET. It works fine. I'm interested in general comments about the code ...
6
votes
1answer
155 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 ...
3
votes
2answers
265 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 ...
5
votes
2answers
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 ...
6
votes
2answers
572 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 ...
6
votes
1answer
120 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 ...
2
votes
0answers
848 views

Using iTextSharp and AddDocument/FreeReader to create a PDF document in streaming fashion

I have a directory of PDF files I want to merge into a single PDF. The number of files in the directory could be 10s, 100s, or even 1000s, so I'm trying to make sure my process is streaming as much ...
2
votes
0answers
2k views

Download a PDF and submit it as a print job

I have following Java code, which is to print PDF, but in a busy location this code is taking about 20 to 30 second delay before submitting to the hardware. get the PDF file via the network download ...
1
vote
1answer
66 views

PDF merging implementation

How can this be improved? ...
5
votes
1answer
183 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, ...
3
votes
1answer
157 views

Split big PDF into smaller documents and insert text at specific position

I’m new to Java programming and uncertain if I used the right approach to solve my job. This little program uses the iText library to split one big PDF into smaller documents. The trigger for this is ...
4
votes
2answers
3k 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. ...
1
vote
0answers
302 views

POJO-based PDF form filler

I'm pretty new to Java development and have written a little POJO to "PDF Form Filler" program. I'd be interested in recommendations and suggestions about coding style, used methods and classes and so ...
2
votes
1answer
311 views

PDF conversion and timestamp tool

Since the last post, I have ported it to WPF (semi-MVVM) and added support for Excel and PowerPoint files, and custom fields and scripts. The conversion is done by interop with office. Apparently ...
4
votes
1answer
674 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 ...
5
votes
1answer
2k 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? ...
4
votes
1answer
133 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 (...
5
votes
3answers
532 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: ...
2
votes
1answer
906 views

Add Field To PDF with Options for Multiple Pages

This is related to here and here. These two methods are used to programatically add a text field to a PDF document. The field can be of any user determined size and have any user determined title, and ...
1
vote
2answers
4k views

PDF Stamper Method to Add Field and Script to PDF File

This is related to my (unanswered) question here, but the code has changed considerably since I asked that question. I have a method that takes the filename of a PDF file and a Script object, and ...
5
votes
1answer
269 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 ...
8
votes
1answer
208 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 ...
4
votes
1answer
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 ...
5
votes
1answer
108 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'...
6
votes
1answer
254 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 ...
4
votes
2answers
3k 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 ...