Skip Menu |

This queue is for tickets about the CAM-PDF CPAN distribution.

Report information
The Basics
Id: 26216
Status: rejected
Priority: 0/
Queue: CAM-PDF

People
Owner: Nobody in particular
Requestors: johan [...] netsense.nl
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.10
Fixed in: (no value)



Subject: changepagestring.pl does not replace string
I tried to replace a string in a pdf file: "changepagestring.pl boven.pdf Boven Dak" However, when I tried it, I got the following error message: **** Expected object open tag 0 %PDF-1.3 %????????? 2 0 ob **** "getpdftext.pl boven.pdf" produces: **** Bovenlicht Onderkant **** Am I doing something wrong? The OS is Mac OS X, 10.4.9, Intel version. perl -v This is perl, v5.8.6 built for darwin-thread-multi-2level (with 3 registered patches, see perl -V for more detail)
Subject: boven.rtf
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} {\info {\author Johan Henselmans} {\*\company Netsense} {\*\copyright All Copyright Johan Henselmans, 2005-}}\paperw11520\paperh4680\margl1440\margr1440\vieww18060\viewh10760\viewkind1\viewscale100 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs24 \cf0 Bovenlicht\ \ \ \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qr\pardirnatural \cf0 Onderkant}
Subject: boven.pdf
Download boven.pdf
application/pdf 8.2k

Message body not shown because it is not plain text.

From: CDOLAN [...] cpan.org
I've reproduced this problem by opening the RTF in TextEdit and printing to PDF under 10.4.9. The problem is that resulting PDF is corrupt -- it wrongly claims that data starts at byte zero, when in fact the data starts at byte 22. I see that the PDF opens in both Acrobat and Preview. Those two applications must be more tolerant of corrupt PDFs than my library is... I think the correct approach is to file a bug report with Apple. Chris
Subject: Re: [rt.cpan.org #26216] changepagestring.pl does not replace string
Date: Wed, 11 Apr 2007 09:29:25 +0200
To: bug-CAM-PDF [...] rt.cpan.org
From: Johan Henselmans <johan [...] netsense.nl>
On 11-apr-2007, at 1:56, via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=26216 > > > I've reproduced this problem by opening the RTF in TextEdit and > printing > to PDF under 10.4.9. The problem is that resulting PDF is corrupt > -- it > wrongly claims that data starts at byte zero, when in fact the data > starts at byte 22. > > I see that the PDF opens in both Acrobat and Preview. Those two > applications must be more tolerant of corrupt PDFs than my library > is... > > I think the correct approach is to file a bug report with Apple. > > Chris >
Thanks for the reply. I'll report the bug to Apple. Is there any way that I can fix the PDF's manually (while waiting for the Apple fix), say by automatically replacing the starting position somewhere in the PDF? Regards, Johan Henselmans http://www.netsense.nl Tel: +31-20-6267538 Fax: +31-20-6273852
Subject: Re: [rt.cpan.org #26216] changepagestring.pl does not replace string
Date: Wed, 11 Apr 2007 07:35:07 -0500
To: bug-CAM-PDF [...] rt.cpan.org
From: Chris Dolan <chris [...] chrisdolan.net>
On Apr 11, 2007, at 2:29 AM, Johan Henselmans via RT wrote: Show quoted text
> Thanks for the reply. > > > I'll report the bug to Apple. Is there any way that I can fix the > PDF's manually (while waiting for the Apple fix), say by > automatically replacing the starting position somewhere in the PDF?
I was about to say no, but perhaps yes. I haven't tried this: Try opening the PDF in a binary-friendly text editor (like emacs) and go to the end of the doc. Find the line that says "000000000 n" and change the "n" to an "f". If I've said that correctly, that should change the corrupt element pointing at byte zero to "unused". But then, it's been several years since I looked at the PDF spec for the document index so I could be remembering incorrectly. Chris -- Chris Dolan, Equilibrious LLC, http://equilibrious.net/ Public key: http://chrisdolan.net/public.key vCard: http://chrisdolan.net/ChrisDolan.vcf
Subject: Re: [rt.cpan.org #26216] changepagestring.pl does not replace string
Date: Wed, 11 Apr 2007 22:13:06 +0200
To: bug-CAM-PDF [...] rt.cpan.org
From: Johan Henselmans <johan [...] netsense.nl>
On 11-apr-2007, at 14:35, Chris Dolan via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=26216 > > > On Apr 11, 2007, at 2:29 AM, Johan Henselmans via RT wrote: >
>> Thanks for the reply. >> >> >> I'll report the bug to Apple. Is there any way that I can fix the >> PDF's manually (while waiting for the Apple fix), say by >> automatically replacing the starting position somewhere in the PDF?
> > I was about to say no, but perhaps yes. I haven't tried this: Try > opening the PDF in a binary-friendly text editor (like emacs) and go > to the end of the doc. Find the line that says "000000000 n" and > change the "n" to an "f". If I've said that correctly, that should > change the corrupt element pointing at byte zero to "unused". But > then, it's been several years since I looked at the PDF spec for the > document index so I could be remembering incorrectly. > > Chris > > -- > Chris Dolan, Equilibrious LLC, http://equilibrious.net/ > Public key: http://chrisdolan.net/public.key > vCard: http://chrisdolan.net/ChrisDolan.vcf > > > >
Chris, just for you info: I reported the bug to Apple (5127826). I also tried what you said, and set the line: 0 18 0000000000 00000 n 0000000281 00000 n 0000000022 00000 n to: 0 18 0000000000 00000 f 0000000281 00000 n 0000000022 00000 n That nearly worked. I could run: changepagestring.pl bovenRTF.pdf 'Onder' 'Door' dak.pdf, but unfortunately, It did replace 'Onder' with 'oor', instead of 'Door'. Thanks for the effort. Regards, Johan Henselmans http://www.netsense.nl Tel: +31-20-6267538 Fax: +31-20-6273852
I still say Apple is at fault, so I'm going to close this bug.