Commit Graph

614 Commits

Author SHA1 Message Date
BobLd
064fa4922a make Clipping internal
do not throw errors when CurrentPath is null
modify tests to match
2020-04-05 17:58:57 +01:00
BobLd
51165dc11a Implement EndPath
Make path clipping optional
2020-04-05 17:58:57 +01:00
BobLd
a7fe39fc32 Add SvgTextExporter
Modify WriteSvg to account for height
2020-04-05 17:58:57 +01:00
BobLd
983cfcb2f6 Simplify path construction operators
fix 're' operator to reflect documentation
Update ContentStreamProcessor with fill, stroke and clip operations
Throw errors when currentPosition is null in PdfSubpath
2020-04-05 17:58:57 +01:00
BobLd
3ee9ac7915 Implement FillStrokePath() operator and filling rule. 2020-04-05 17:58:57 +01:00
BobLd
5eb2cc507e Add CurrentClippingPath to CurrentGraphicsState 2020-04-05 17:58:57 +01:00
BobLd
83ef10ec22 Add Clipping helper class. Does nothing for the moment 2020-04-05 17:58:57 +01:00
BobLd
43b40da5d5 Change Subpath to path where necessary 2020-04-05 17:58:57 +01:00
BobLd
002d8dc06d Move Path-Painting Operators to PathPainting folder 2020-04-05 17:58:57 +01:00
BobLd
c4a077bbbb Add IsFilled and IsStroked flags
Add CloneEmpty() and GetBoundingRectangle()methods
2020-04-05 17:58:57 +01:00
BobLd
2b68547131 Moving PdfPath from PdfPig.Core to PdfPig
Add FillColor, StrokeColor, LineWidth, LineDashPattern and LineCapStyle to PdfPath.
2020-04-05 17:58:57 +01:00
BobLd
6677641b37 Create PdfPath
Rename ClippingRule to FillingRule
Move FillingRule from Subpath to Path
2020-04-05 17:58:57 +01:00
BobLd
ab6a0f11fc Change name from PdfPath to PdfSubpath 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
729234477a fix issue with null encodings for cid fonts 2020-04-04 17:30:06 +01:00
Eliot Jones
9abe9f4b2f #158 add strong naming to the solution 2020-04-04 16:59:51 +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
BobLd
5f0ddf131e make OrientedBoundingBox public 2020-03-24 19:52:01 +00:00
Eliot Jones
4ed1600cab version 0.1.1 2020-03-18 20:10:51 +00:00
Eliot Jones
0f91017613 fix issue with newlines in object start tokens #88
where we brute force the file and it contains newlines between object tokens we fix the parsing to prevent pseudo-infinite loops.
2020-03-17 20:09:47 +00:00
Eliot Jones
5094f9d9d0 remove debugging code
this code was used to check content streams but should not be committed.
2020-03-16 19:32:57 +00: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
Eliot Jones
8ac4195b83 0.1.1-alpha001 2020-03-15 16:52:28 +00:00
BobLd
c1a1fa1f7f - fix minimum area rectangle algo and make it public
- add tests
- tidy up code
2020-03-15 17:20:36 +01: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
BobLd
5b8a2f2e38 handle k-nearest neighbours search
update DocstrumBB with kd-tree
2020-03-15 15:39:19 +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
BobLd
1e1a33d46e fix typo in kd-tree
replace Count() by Count or Length
2020-03-06 16:53:18 +00:00
Eliot Jones
bef68a0654 avoid infinite loop in brute-force searcher #88
fixes the case where the brute-force searcher becomes stuck in an infinite loop, it may be the case that the problem pdf from #88 has a newline or some other whitespace between its object and generation number so this may cause a failure elsewhere.
2020-03-03 15:49:17 +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
Eliot Jones
2effedd3c5 add inheritable keys back into the copied pages node
keys suchs as resources, mediabox, cropbox, etc can be inherited. we now copy them if they are present on the parent pages node.
2020-03-02 17:00:16 +00:00
Eliot Jones
c596bef024 rename to resharper conventions and test 2nd page
renames fields to match the expected conventions for resharper. removes fully qualified names for using statements since resharper marks these as not-required.

adds a check to the pdf merger test to make sure the second page has the expected content. this is not currently valid since we lose the resources node on the pages tree.
2020-03-02 17:00:16 +00:00
Inusual
b560c73fa9 Set the version as the highest version found in the merged document
And reorganize the code a little bit
2020-03-02 17:00:16 +00:00
Inusual
ca250a8c6f IsLenientParsing as false 2020-03-02 17:00:16 +00:00
Inusual
439a186ed7 Remove dead code 2020-03-02 17:00:16 +00:00
Inusual
932857cf8c Revert "Don't forget to copy /Pages properties too"
This reverts commit 224d9dc6e52245f9d16a22af460f386545403cd1.
2020-03-02 17:00:16 +00:00
Inusual
20ff625c2e Don't forget to copy /Pages properties too 2020-03-02 17:00:16 +00:00
Inusual
ec67ef76cd Remove ObjectsTree class since it's obsolete 2020-03-02 17:00:16 +00:00
Inusual
4ffc1620a1 Don't create unnecessary objects 2020-03-02 17:00:16 +00:00
Inusual
761e3d291e Rename DocumentBuilder to DocumentMerger
Remove IDisposable trait
2020-03-02 17:00:16 +00:00