Questions tagged [cam-pdf]

CAM::PDF is a Perl library for reading and modifying existing PDF files

CAM::PDF is a Perl library for low-level reading and modification of existing PDF files. It is very fast, but it cannot create PDF files from scratch nor does it include a high-level API for document editing. It originated at Clotho Advanced Media, hence its name. See http://search.cpan.org/dist/CAM-PDF/lib/CAM/PDF.pm

19 questions
5
votes
2 answers

How can I read PDF document properties using Perl and CAM::PDF?

I want to read some PDF document property with Perl. I already have CAM::PDF installed on my system. Is there an option to use this module to read the properties of a PDF document? If yes could someone give an example or refer to the relevant…
smith
  • 3,232
  • 26
  • 55
4
votes
1 answer

How to update PDF metadata with CAM::PDF

How can I add/overwrite the title and author metadata of a PDF using CAM::PDF?
pilcrow
  • 56,591
  • 13
  • 94
  • 135
3
votes
2 answers

How to delete all images from a PDF without corrupting it using CAM::PDF?

The script below is able to remove all images from a PDF file using CAM::PDF. The output, however, is corrupt. PDF readers are nonetheless able to open it, but they complain about errors. For instance, mupdf says: error: no XObject subtype…
n.r.
  • 1,900
  • 15
  • 20
1
vote
0 answers

CAM::PDF reload DV node

Have a node with default values like this: bless({ gennum => 0, objnum => "281", type => "object", value => bless({ gennum => 0, objnum => 281, type => "dictionary", value => { …
Oleg Beat
  • 333
  • 1
  • 5
  • 16
1
vote
3 answers

Perl: CAM::PDF makes changes, but these don't materialise in final doc

I've been using the CAM::PDF module to try editing pdf docs at work - essentially just trying to change the date on docs automatically to show they have been reviewed recently unfortunately, despite my code telling me that I am making changes to the…
George c
  • 65
  • 1
  • 9
1
vote
1 answer

Search & replace issue on mPDF, CAM'PDF on Ubuntu 18.04

On Ubuntu 18.04 I have a problem with editing PDF files - specifically search & replace strings. I tried: PHP mPDF Overwrite () do nothing. perl CAM :: PDF 1.60 changepagestring.pl do nothing sed, do nothing. Does not work with compressed or…
Sasa Jovanovic
  • 324
  • 2
  • 14
1
vote
1 answer

how to use CAM::PDF to find + replace from command line

Sorry for the noob question. I just downloaded CAM::PDF along with Strawberry for Windows, and trying to do find/replace from the command line. Ran buidinstalldeps to get all needed prereqs. I'm trying to run changepagestring.pl from command line.…
ellipsical
  • 39
  • 1
  • 2
1
vote
0 answers

Errors reading PDF with CAM-PDF: use of uninitialized value in addition <+> line 667

I'm new to perl and I'm trying to read a pdf file using CAM::PDF here is my code: When I try to run this in the command prompt I get these errors: "Use of uninitialized value in addition <+> at C:/Strawberry/perl/site/lib/CAM/PDF.pm line 667 ...…
markdid
  • 11
  • 3
1
vote
0 answers

CAM::PDF font resource (Where?)

All, Good News: Using CAM::PDF fillFormFields to complete a PDF Form. Bad News : Getting "Could not find resource /Helv while preparing form field". I suspect the Win32 font /Helv is not know by CAM::PDF. Question: Where does CAM::PDF look for…
1
vote
1 answer

Using CAM::PDF for Perl - Can not extract image from pdf

I have a pdf file that listimages.pl which uses CAM::PDF returns nothing but using PDF::GetImages will extract an image. Using the following code I can find the image object but I don't know how to extract that to a file. And I can not figure out…
Stephen Woodbridge
  • 1,100
  • 1
  • 8
  • 16
1
vote
3 answers

CAM::PDF returning non ascii character instead of quotes

I am having trouble with non ascii characters being returned. I am not sure at which level the issue resides. It could be the actual PDF encoding, the decoding used by CAM::PDF (which is FlateDecode) or CAM::PDF itself. The following returns a…
Michael
  • 309
  • 2
  • 3
  • 16
0
votes
1 answer

Serving merged PDF to the browser using CAM::PDF library

EDIT: I changed my question again: I am using this library to manipulate PDF files. I am using this code to serve the output to the browser: #!perl use strict; use warnings; use lib "..\\mymodules\\CAM-PDF-1.57\\lib"; use CAM::PDF; my $pdf =…
Yaron
  • 1,540
  • 3
  • 19
  • 33
0
votes
0 answers

CAM::PDF Error "Expected String Closing" when editing PDF file

Im using CAM::PDF with Perl to delete/replace some text in pdf files that are only 1 page. my $repl_str = "redacted" my $pdf = CAM::PDF->new($file_name) or die("Couldn't read PDF $file_name: $CAM::PDF::errstr"); my $content =…
HPW
  • 9
  • 1
0
votes
1 answer

Error "Can't call method appendPDF on an undefined value" in merging multiple pdf files into one pdf using perl script

I want to merge multiple pdf files into one pdf using perl script. I am new in perl script and using CAM::PDF module for merging PDFs but facing below error: Can't call method "appendPDF" on an undefined value. Can you please help me where I am…
0
votes
1 answer

Dynamic PDF Forms CAM::PDF + PDFLib

Are there any case to dynamic manage a PDF using PDFLib properties and setting form fields ? my %list = (); $doc->fillFormFields( %list );
Oleg Beat
  • 333
  • 1
  • 5
  • 16
1
2