johnwhitington / cpdf-source Goto Github PK
View Code? Open in Web Editor NEWPDF Command Line Tools Source
License: GNU Affero General Public License v3.0
PDF Command Line Tools Source
License: GNU Affero General Public License v3.0
When using stamp-on
or stamp-under
features, cpdf
is stripping hyperlink annotations from stamping file (that is, hyperlink annotations that were present in stamping file are not present in resulting PDF).
<bug>
<bug_id>289</bug_id>
<creation_ts>2012-02-24 04:51</creation_ts>
<short_desc>-add-bookmarks should allow more complicated destinations</short_desc>
<delta_ts>2012-02-24 04:51:42</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>enhancement</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-02-24 04:51:42</bug_when>
<thetext></thetext>
</long_desc>
</bug>
Find them (in /Resources), then combine the page resources with the xobject resources, so we can parse the page ops. Then proceed as per pages.
Tries to be too clever for its own good. Fix up.
<bug>
<bug_id>386</bug_id>
<creation_ts>2012-05-18 06:09</creation_ts>
<short_desc>-stamp-on etc should obey position commands.</short_desc>
<delta_ts>2012-05-18 06:09:53</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>enhancement</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-05-18 06:09:53</bug_when>
<thetext></thetext>
</long_desc>
</bug>
<bug>
<bug_id>409</bug_id>
<creation_ts>2012-09-10 11:20</creation_ts>
<short_desc>-split-bookmarks on large/PDF32000.. produces big splits</short_desc>
<delta_ts>2012-10-04 10:07:48</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>major</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-09-10 11:20:15</bug_when>
<thetext></thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-09-10 11:24:03</bug_when>
<thetext>Ditto with normal -split
Also, -split takes ages - what is it doing?
</long_desc>
</bug>
An install through opam (1.2.0) was successful but did not result in a cpdf
binary being installed. A build from source fails:
ocamlfind ocamlopt -package camlpdf -c -annot -g cpdf.ml
File "cpdf.ml", line 282, characters 12-37:
Error: This function has type
string option -> string option -> Pdfio.input -> Pdf.t
It is applied to too many arguments; maybe you forgot a `;'.
OCamlMakefile:1076: recipe for target 'cpdf.cmx' failed
hello ,
I have a pdf which has unicode text, I am trying to strip out all the fonts in the pdf using -remove-fonts option so that only the image objects remain. I get partial success in doing that. i.e the fonts turn into blobs and adobe acrobat complains "Cannot find or create the font 'AKKUUO+ChiruthaHeavy'.Some characters may not display or print correctly ".
ScreenShot of Converted pdf after using the command cpdf -remove-fonts in.pdf -o out.pdf
.
ScreenShot of the above corrupt pdf after converting it into an image using imageMagick/GhostScript.
<bug>
<bug_id>276</bug_id>
<creation_ts>2012-01-25 06:27</creation_ts>
<short_desc>Draft command doesn't work on images in xobjects.</short_desc>
<delta_ts>2012-01-25 06:27:11</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>enhancement</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-01-25 06:27:11</bug_when>
<thetext>Write a function for operating on all streams with their resources, preserving xobjects.</thetext>
</long_desc>
</bug>
<bug>
<bug_id>406</bug_id>
<creation_ts>2012-08-23 09:43</creation_ts>
<short_desc>Test scale-to-fit with FIXMEs about box changing / scaling failures.</short_desc>
<delta_ts>2012-10-03 07:35:29</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>major</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-08-23 09:43:45</bug_when>
<thetext></thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-09-20 08:42:31</bug_when>
<thetext>*** Bug 418 has been marked as a duplicate of this bug. ***</thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-10-03 07:35:29</bug_when>
<thetext>So, the correct solution to this is to rewrite it in terms of scale_contents, and then fix up the change_boxes command.
For 1.8<
I've got a pull request at OCamlPro/opam-repository#1100 that installs the cpdf
binary as well the library. This would require the README in this repository, but I just wanted to check if there was a reason why the binary isn't installed by default by the OPAM package.
<bug>
<bug_id>438</bug_id>
<creation_ts>2013-08-02 12:38</creation_ts>
<short_desc>-rotate-contents problem in awlogo.pdf</short_desc>
<delta_ts>2013-08-05 05:17:24</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>ASSIGNED</bug_status>
<priority>P5</priority>
<bug_severity>major</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2013-08-02 12:38:03</bug_when>
<thetext>Butterfly looks wrong...</thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2013-08-02 12:39:42</bug_when>
<thetext>Pretty sure this used to work -- check with cpdf 1.6!</thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2013-08-05 05:17:24</bug_when>
<thetext>Not a regression. Fix for 1.8.</thetext>
</long_desc>
</bug>
<bug>
<bug_id>440</bug_id>
<creation_ts>2013-08-05 08:04</creation_ts>
<short_desc>-range should also work for -stdin</short_desc>
<delta_ts>2013-08-05 08:04:26</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>enhancement</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2013-08-05 08:04:26</bug_when>
<thetext></thetext>
</long_desc>
</bug>
cpdf won't even try to process files with a badly formed page tree. For example, any file created by the iCopy scan tool:
> cpdf -rotateby 90 scan.pdf -o scan2.pdf
cpdf encountered an error. Technical details follow:
badly formed page tree B
For example, use this pdf.
Admittedly, this is probably iCopy's fault, but it seems that cpdf should at least try to process it seeing the viewers can all display it.
feast:cpdf-source john$ ./cpdf enc/ownerfredusercharles.pdf user=charles -recrypt -o out.pdf
cpdf encountered an error. Technical details follow:
Encryption 128 failed
Perhaps add detection that we never read any xref table at all. Then, we can say it must have been too high.
Also document recrypt here.
<bug>
<bug_id>250</bug_id>
<creation_ts>2012-01-11 07:49</creation_ts>
<short_desc>Kerning support for standard 14 fonts in addText</short_desc>
<delta_ts>2012-01-11 07:49:31</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>enhancement</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-01-11 07:49:31</bug_when>
<thetext>Dependent on AFM parser to resolve problem with WinAnsi text being added but widths being in standard encoding...</thetext>
</long_desc>
</bug>
<bug>
<bug_id>441</bug_id>
<creation_ts>2014-03-05 10:21</creation_ts>
<short_desc>@F isn't held across AND, so it no use then.</short_desc>
<delta_ts>2014-03-05 10:21:46</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>blocker</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2014-03-05 10:21:46</bug_when>
<thetext></thetext>
</long_desc>
</bug>
It seems that the (malformed?) bookmarks generated by the wkhtmltopdf tool/library cannot be handled by cpdf.
cpdf lists no bookmarks for such files, however they show up normally in pdf readers like Adobe Reader.
This would allow changing colour etc. in the middle of a line of text. Another possibility is to introduce codes such as \colour{red}, \font{Courier} etc. into the text of -add-text
<bug>
<bug_id>410</bug_id>
<creation_ts>2012-09-11 03:35</creation_ts>
<short_desc>-split on PDFTests/large/PDF3200... takes a long time in parse_delayed_object_streams / pdfobjmap_bindings</short_desc>
<delta_ts>2012-10-04 10:09:18</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>major</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-09-11 03:35:31</bug_when>
<thetext></thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-10-04 10:09:18</bug_when>
<thetext>This is a fundamental problem with the way parse_delayed_object_stream works - we need to store upon opening which object numbers will be affected by each stream being opened, and then just iterate over those alone.
Fixable.
</long_desc>
<bug_id>260</bug_id>
<creation_ts>2012-01-17 12:22</creation_ts>
<short_desc>Cpdf.build_name_tree produces flat list. Move this code out to its own module and fix up.</short_desc>
<delta_ts>2012-02-20 11:04:17</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>REOPENED</bug_status>
<priority>P5</priority>
<bug_severity>major</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-01-17 12:22:20</bug_when>
<thetext></thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-02-19 10:37:10</bug_when>
<thetext>
*** This bug has been marked as a duplicate of bug 266 ***
</long_desc>
Is there any plan to support addition/modification of annotations in the near future? I wouldn't mind contributing but I don't really know where to start.
<bug>
<bug_id>439</bug_id>
<creation_ts>2013-08-05 07:52</creation_ts>
<short_desc>'even' and 'odd' should work as modifiers with tilde-ranges</short_desc>
<delta_ts>2013-08-05 07:52:06</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>major</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2013-08-05 07:52:06</bug_when>
<thetext>For example, "~8-~1odd" is parsed to "~8 - ~1odd" which then fails.</thetext>
</long_desc>
</bug>
Does this always happen on multipage files?
-squeeze fixes it, but we must fix it at the root
<bug>
<bug_id>442</bug_id>
<creation_ts>2014-03-25 06:23</creation_ts>
<short_desc>-decompress carries on if it can't decompress a stream -- but that can lead to blank streams? what happens? check.</short_desc>
<delta_ts>2014-03-25 06:23:32</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>enhancement</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2014-03-25 06:23:32</bug_when>
<thetext></thetext>
</long_desc>
</bug>
<bug>
<bug_id>412</bug_id>
<creation_ts>2012-09-12 04:38</creation_ts>
<short_desc>merge doesn't maintain bookmarks which point to null destinations</short_desc>
<delta_ts>2012-10-03 06:46:58</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
<classification_id>1</classification_id>
<classification>Unclassified</classification>
<product>cpdf</product>
<component>cpdf</component>
<version>unspecified</version>
<rep_platform>PC</rep_platform>
<op_sys>Mac OS</op_sys>
<bug_status>NEW</bug_status>
<priority>P5</priority>
<bug_severity>major</bug_severity>
<target_milestone>---</target_milestone>
<everconfirmed>1</everconfirmed>
<reporter name="John Whitington">[email protected]</reporter>
<assigned_to name="John Whitington">[email protected]</assigned_to>
<estimated_time>0.00</estimated_time>
<remaining_time>0.00</remaining_time>
<actual_time>0.00</actual_time>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-09-12 04:38:18</bug_when>
<thetext>see PDFTests/nullbookmarkfailsonmerge.pdf</thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-09-20 08:41:27</bug_when>
<thetext>Also, simple in/out read seems to remove it? -list-bookmarks, -merge, -add-bookmarks. Pdfdest.NullDestination vs page 0 in bookmarks file?</thetext>
</long_desc>
<long_desc isprivate="0">
<who name="John Whitington">[email protected]</who>
<bug_when>2012-10-03 06:46:58</bug_when>
<thetext>Now mostly fixed.
We could improve by having each null destination one in a merge point to the first page of that document.
</long_desc>
</bug>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.