Commit Graph

108 Commits

Author SHA1 Message Date
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
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
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
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
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
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
901e4d1ac9
Merge pull request #259 from plaisted/master
PdfMerger: Fix indirect object lookup dict
2021-01-15 09:35:15 -04: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
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
Eliot Jones
d8e0263ec7 #215 support filling rectangles on pdf builder 2020-11-17 17:00:13 -04:00
Eliot Jones
9b7554c973 #203 enable utf16 be strings to be written to the document builder 2020-08-27 09:06:14 +01:00
Eliot Jones
54f227ea95 add support for extracting grayscale images and inline images 2020-08-22 15:08:59 +01:00
Eliot Jones
5ac7a957d0 add initial png support 2020-08-21 10:50:17 +01:00
Eliot Jones
142c871c47 update editorconfig to override other project defaults 2020-07-26 14:29:18 +01:00
Eliot Jones
e42df5b5b5 fix remaining missing culture dependent strings #190 2020-07-26 14:14:37 +01:00
Eliot Jones
09b951f667 expose font details on individual letters
also fixes a regression for image extraction
2020-04-25 17:15:26 +01:00
Eliot Jones
19047f62ae fix name output for merged documents 2020-04-25 11:23:37 +01:00
Eliot Jones
27e251f921 make filter provider and filter public and use tryget for image bytes 2020-04-25 09:42:24 +01:00
Eliot Jones
635ae13a77 add pdf/a2-a support 2020-04-16 20:50:21 +01:00
BobLd
002d8dc06d Move Path-Painting Operators to PathPainting folder 2020-04-05 17:58:57 +01:00
Eliot Jones
f1be6634a7 add a bunch more performance improvements
filter provider becomes single instance and no longer has constructor parameters.

tokenizers use list and stringbuilder pools to reduce allocations.

system font finder becomes static to preserve file cache across all documents.
2020-04-05 15:34:47 +01:00
Eliot Jones
cf46230c05 #127 add pdf/a2-b compliance to the builder 2020-04-04 17:49:27 +01:00
Eliot Jones
7f1bf094bc #127 pdf/a-1a compliance
adds struct tree and markinfo dictionaries to support pdf/a-1a compliance.
2020-03-29 17:55:02 +01:00
Eliot Jones
5f45ee53bd #127 add basic pdf/a-1b level compliance to the document builder
adds color profiles/output intents and an xmp metadata stream to the document in order to be compliant with pdf/a-1b (basic). this compliance level is toggled on the builder since it will generate larger files and set to 'off/none' by default. pdf/a documents are also not able to use standard fonts so using a font when the compliance level is not none will throw.
2020-03-29 16:43:52 +01:00
Eliot Jones
98bcc16e11 fix width and height order in jpeg parsing
height is before width, incorrect order caused adobe reader to draw image strangely.
2020-03-16 19:32:57 +00:00
Eliot Jones
7212b9e38c enable re-use of jpeg images between or within pages
returns a reference to the added image object when calling addjpeg so that it can be shared between or within pages meaning the image is only written to the output file once but can appear multiple times.

this image doesn't seem to be displaying correctly in adobe reader.
2020-03-16 19:32:57 +00:00
Eliot Jones
19462d79f0 add support for jpeg images in pdf document builder
since jpegs can be trivially embedded in pdf documents without changes to the data stream this is the first image format we will support. currently this is a naive approach which doesn't share an image resources between pages. ideally we will either de-duplicated images when added, return a re-usable key once an image is added, or both.
2020-03-16 19:32:57 +00:00
InusualZ
bd6b03c2e8 Removed the possibility of deepCopy a token.
Anyway, the DataToken properties most are readonly, If you want to change something. You have to crate a new token anyway.  Discussion: https://github.com/UglyToad/PdfPig/pull/150
2020-03-15 16:05:23 +01:00
InusualZ
3abe210c6f Add new flag to control, weather we want to dispose the base stream.
Let the base stream throw in case of using unsupported method (Ex. Seek, Read, etc..)
2020-03-15 16:05:23 +01:00
InusualZ
b3f310a249 Make PdfMerger use the PdfStreamWriter 2020-03-15 16:05:23 +01:00
InusualZ
44ad5c8b0c PdfStreamWriter: Error Checking and Code Formatting 2020-03-15 16:05:23 +01:00
InusualZ
c533d47386 New class PdfStreamWriter
This class would allow us to lazily flush resource. This would allow us to make changes to them, while new content is pushed. Compress, Merge, Deduplicate, etc...
2020-03-15 16:05:23 +01:00
Eliot Jones
8df2f9cf6b generate all xml docs and pack them #148
after we split the solution into multiple projects the xml doc comments were no longer packed in the generated nuget package. in addition they were only generated for the net standard 2.0 target framework.

this change generates comments for all target frameworks and makes sure they're included in the generated package. it also adds missing doc comments where they weren't included on the public api and clears up a couple of minor formatting issues in the affected files.
2020-03-08 13:44:09 +00:00
Eliot Jones
24c5cbea4b support custom page sizes for document builder #147
page size custom is not supported for the document builder so a new overload which supports user defined page sizes is provided.
2020-03-07 16:48:19 +00:00
InusualZ
ab3779e644 Fix an issue where the root/Pages Count was incorrect
`/Pages` Count should reflect the number leaf nodes (page objects) that are descendants of this node.
2020-03-07 16:47:35 +00:00
Eliot Jones
58972de7cb begin to rework cross-reference parsing
most of the cross-reference code is the earliest code in the project and hasn't been revisited since then. the issue #88 has been reopened due to a bug with brute-force searching so this tidies up the code in this area ahead of trying to fix the bug.
2020-03-03 15:21:11 +00:00