Commit Graph

971 Commits

Author SHA1 Message Date
BobLd
30dbc4cd41 Merge pull request #282 from BobLd/266-layers
Optional content (aka layers collections) partial extraction
2021-02-15 09:27:43 +00:00
BobLd
3b1a7f79ca Add test with no optional content, return IReadOnlyDictionary<>, use pdfScanner in OC constructor 2021-02-14 21:40:40 +00:00
Eliot Jones
25cc3c8634 Merge pull request #279 from plaisted/edit-docs-v2
Add pages from PdfDocument to PdfDocumentBuilder
2021-02-14 09:58:08 -04:00
BobLd
4cd1f60f5b Move GetOptionalContents into Experimental and get optional marked content recursively 2021-02-13 15:01:06 +00:00
Plaisted
4b8925a442 fix missing change 2021-02-10 20:56:51 -06:00
Plaisted
ef0bcd2055 changes for intital InusualZ review 2021-02-10 20:18:03 -06:00
Plaisted
509164447b review changes from Poltuu, test coverage for token replacement 2021-02-10 12:27:12 -06:00
Eliot Jones
68dd3f5a75 add device cmyk support for png conversion 2021-02-08 18:40:28 -04:00
Eliot Jones
c19742a2ae make converter public and add separation color space 2021-02-08 18:40:28 -04:00
Eliot Jones
9fc44f50d2 fix indexing into indexed color space by using table 2021-02-08 18:40:28 -04:00
Eliot Jones
6c293011a2 keep the bytes factory call which was accidentally removed 2021-02-08 18:40:28 -04:00
Eliot Jones
fad06eac27 add full color space details and transformation into full bytes for indexed 2021-02-08 18:40:28 -04:00
Plaisted
e7f96c0b16 add changes from unsaved file 2021-02-08 12:53:02 -06:00
Plaisted
6e1cf89cf9 clean up pagebuilder, switch merger to use pdfdocumentbuilder 2021-02-08 12:37:09 -06:00
Romain V
c008340b2b fixes NullToken for a font (#284)
font was in a streamObject, PdfTokenScanner.ParseObjectStream would return a NullToken
DirectObjectFinder.Get would then throw on line 79, even thus it should handle null tokens (i.e. ResourceStore.LoadFontDictionary line 152)
2021-02-08 11:19:39 -04:00
Plaisted
ca0b90523e fix bug where default stream reader wrote header for every object 2021-02-07 10:51:02 -06:00
Plaisted
c6ed29bda4 cleanup stream writing to only write multiple when needed 2021-02-07 10:37:31 -06:00
Eliot Jones
6f49b2e29e Fix buggy font (#283)
* Adds checksum on font file reading

* fix name table parsing on broken table

* only warn if checksum invalid, avoid exception with bounds check #258

also returns a null object when the object generation number exceeds
ushort.maxvalue since this is the maximum allowed value and this
broke tests attempting to parse all objects in the file from #258

* remove potentially problematic document

it might be sensitive data

* use ttf from file to test without including full file

Co-authored-by: romain v <rvergnory@lucca.fr>
2021-02-07 12:23:11 -04:00
Eliot Jones
9d99ac4e9b handle completely null content #243 2021-02-07 12:22:07 -04:00
BobLd
78e6e582cd Partial optional content extraction: Add page.GetOptionalContents() and add tests. 2021-02-07 12:42:20 +00:00
Plaisted
442fa8fb6d create page tree for builder to help with large pdfs 2021-02-06 20:35:01 -06:00
Plaisted
1db481164c perf improvement for copying lots of pages from large documents 2021-02-06 18:04:13 -06:00
Plaisted
92f9af613f more build system c# version fixes 2021-02-06 15:31:58 -06:00
Plaisted
44ee6d394f cleanup font usage, fix some build system issues with older c# version 2021-02-06 15:13:22 -06:00
Plaisted
7f42ad0af9 refactored previous work to fit pr #250 2021-02-06 12:24:53 -06:00
Eliot Jones
be9fd4b071 add a couple of missing name tokens for viewports and measurements 2021-02-06 12:15:23 -04:00
Eliot Jones
d3502fdfc0 allow a checkbox to not declare a value and only be checked by appearance #267
in the example document in issue #267 the checkbox declares an
appearance state with no corresponding value, as long as the checkbox
defines its appearances dictionary we treat non-off checkboxes as checked
if there is no corresponding value in the checkbox form field dictionary
2021-02-06 11:58:35 -04:00
Eliot Jones
566724043d Merge pull request #250 from InusualZ/edit-pdf
[New Feature] PdfPageBuilder: Allow to copy pages from another document
2021-02-06 09:50:09 -04:00
Eliot Jones
660ac5f486 Merge pull request #269 from plaisted/builderpool
Remove locks / SB pooling during CoreTokenScanner parsing
2021-01-20 08:28:37 -04:00
Eliot Jones
1d36098ec5 Merge pull request #240 from BobLd/type1-flex
Correct letter bbox for Type1 font/flexpoints - Fix #217
2021-01-20 08:26:51 -04:00
Plaisted
a0f0c4d6c7 switch to old syntax for build server 2021-01-19 18:53:44 -06:00
Plaisted
4c807691b7 adding in PlainTokenizer to unpooled SB changes 2021-01-19 18:52:14 -06:00
Plaisted
feb6117e1e fix EOL issues 2021-01-19 18:39:51 -06:00
Plaisted
0b716a759f adding comment for non-static tokenizer 2021-01-19 18:18:33 -06:00
Plaisted
9bfe69aef1 removing locking 2021-01-19 18:06:50 -06:00
BobLd
a7a021531c Merge pull request #263 from BobLd/pdfrectangle-width-fix
Use Euclidean distance in PdfRectangle's width and height
2021-01-16 10:31:35 +00:00
Eliot Jones
901e4d1ac9 Merge pull request #259 from plaisted/master
PdfMerger: Fix indirect object lookup dict
2021-01-15 09:35:15 -04:00
BobLd
980c6e2316 Use Euclidean distance in PdfRectangle's width and height 2021-01-15 11:20:45 +00:00
Plaisted
8b7fb5274f PdfMerger: Correcting indirect object lookup dict to use dictionary compatible key 2021-01-14 13:57:28 -06:00
romain v
5dbee43dbb Adds output stream support in pdfmerger methods 2021-01-14 09:33:48 +01:00
romain v
a1abf99afc PdfMerger favors streams instead of byte[]
Also, adds api similar to PdfDocument regarding streams
2021-01-14 09:33:05 +01:00
Romain V
19e831b656 fix stackoverflow on pdfmerger (#252)
Obj Ref1
 Kids: [Ref2]

Obj Ref2
 Parent: Ref1
2021-01-08 21:35:19 +00:00
Wesley Moret
7239396665 Allow to have empty code space, fixes #256 (#257) 2021-01-08 20:50:33 +00:00
Wesley Moret
19ac38bf8b [Improved] PdfMerger: Allow to select the pages when merging documents (#248)
* PdfMerger: Allow to select the pages when merging documents

Supersede #245

* Impose artificial limit in the amount of page, that a node can contain

Plus, Use IReadOnlyList instead of IReadOnlyCollection
2021-01-05 00:31:37 +00:00
Eliot Jones
eabe6b4662 Merge pull request #246 from InusualZ/merger-stackoverflow
Fix #199
2020-12-23 10:54:01 -04:00
InusualZ
e9c8fbbbaa Fix TokenWriter::WriteString not escaping properly special characters 2020-12-20 19:34:13 +00:00
InusualZ
7126564eef Allow to copy pages from another document
This is a naive implementation, because if you copy multiple pages from the same document, the recipient document would be bloated with duplicated resources
2020-12-20 19:13:19 +00:00
InusualZ
ba5bc1f031 Allow to have multiple content stream in a page
You can create new content stream (NewContentStreamAfter, NewContentStreamBefore) and select (SelectContentStream) which one we are editing at the moment
2020-12-19 10:41:36 +00:00
InusualZ
4e4377c5d4 Address Merger test issue and removed dead code. 2020-12-14 17:39:16 +00:00
InusualZ
d676755f55 Fix #199
In large file brute forcing the search of a specific token can be quite difficult. Detecting duplicated token can be made in a more performance way.
2020-12-09 17:26:41 +00:00