Commit Graph

1362 Commits

Author SHA1 Message Date
BobLd
46a04c21f5 Fix integration tests for #579 2023-04-12 17:56:21 +01:00
BobLD
b8a98fbed2 Properly implement color spaces 2023-04-12 07:25:09 +01:00
Eliot Jones
db0583edea
Merge pull request #597 from UglyToad/BobLd-patch-1
Update run_integration_tests.yml
2023-04-11 20:46:32 +02:00
Eliot Jones
6bca81fca2
Merge pull request #596 from GiovanniNova/master
Support for full-size images without specifing size
2023-04-11 20:43:33 +02:00
BobLd
92f47df9f6
Update run_integration_tests.yml
Update integration tests action dotnet version from 2.1.x to 3.1.x
2023-04-10 17:41:05 +01:00
mvantzet
0e39bc0b76
Annotations named destinations (#579)
* Add Named Destinations to Catalog so that bookmarks and links can access
them.

The named destinations require access to page nodes, so created Pages object
that is made using PagesFactory (which contains the page-related code from
Catalog).

* Further implementation of destinations:
- Implement NamedDestinations in AnnotationProvider, so that we can look
  up named destinations for annotations and turn them into explicit destinations.
  Reused existing code inside BookmarksProvider to get destinations/actions.
- Added GoToE action
- According to the PDF reference, destinations are also required for
  external destinations and hence for ExternalBookmarkNode. This allows us
  to push up DocumentBookmarkNode.Destination to BookmarkNode.

* Implemented stateful appearance streams and integration test

* Added AppearanceStream to public API because it is used in the (public)
Annotation constructor

* After #552, must push down ExplicitDestination do DocumentBookmarkNode since it
does not apply to UriBookmarkNode.

* Added actions, which fits the PDF model better and works well with the
new bookmarks code (after PR #552)

* Rename Action to PdfAction + removed unused using in ActionProvider.cs

---------

Co-authored-by: mvantzet <mark@radialsg.com>
2023-04-10 17:14:14 +01:00
GiovanniNova
cdc91eeef7 Support for full-size images without specifing size 2023-04-10 11:14:20 -03:00
Alejandro
2e0622b652 Possibility to set CreationDate and ModifiedDate in DocumentInformationBuilder 2023-04-02 12:35:58 +01:00
Yufei Huang
bd4eedfcac make Bookmarks constructor public 2023-03-30 18:06:04 +01:00
BobLd
2dabaf1348
Update System.Drawing.Common version in Tests (#584) 2023-03-26 19:42:35 +01:00
BobLd
93a2f318aa
Fix Type 3 font height and fix #500 (#585) 2023-03-26 19:20:20 +01:00
BobLd
58b3394d01
Setting C# version to latest in Examples and ConsoleRunner projects (#582) 2023-03-25 19:15:01 +00:00
Fred Natzke
10fa9eceb9
FixIssue576-AddPng-WithTransparency SMask hardcoded as 8 bitsPerComponent not 1. (#577) 2023-03-25 16:30:02 +00:00
BobLd
3dd9a5685d
Fix PR #552 failing integration tests (#580) 2023-03-25 16:29:28 +00:00
Yufei Huang
a3a9d1a2b5
Support adding outline bookmarks to existing pdf document (#552)
Support adding outline bookmarks to existing pdf document
2023-03-23 10:21:11 +00:00
BobLd
a486114c8d
Merge pull request #573 from GiovanniNova/master
Fixes #567, ReadShort now casts to and returns an ushort
2023-03-22 18:49:46 +00:00
GiovanniNova
aeb08744cb Fixes #567, ReadShort now casts to and returns an ushort 2023-03-21 11:13:48 -03:00
BobLd
c024e6abd0
Merge pull request #570 from UglyToad/alpha-operator
AlphaConstants and more named graphics state
2023-03-19 20:52:13 +00:00
BobLD
fc3f27fd18 Update CurrentGraphicsState with AlphaConstantNonStroking and AlphaConstantStroking and implement more named graphics state 2023-03-19 13:23:06 +00:00
BobLd
76d7667924
Merge pull request #569 from UglyToad/stream-processor-step-1
Make some necessary classes public
2023-03-19 01:33:29 +00:00
BobLD
d3f8e83b27 Make some necessary classes public 2023-03-17 21:43:15 +00:00
Eliot Jones
a5c91f00d9 remove invalid constructor 2023-03-17 22:32:22 +01:00
Eliot Jones
ec5b3b551a
Merge pull request #545 from UglyToad/pdf-to-image-glyph-path
Implement TryGetPath and TryGetNormalisedPath for fonts
2023-03-17 22:02:32 +01:00
BobLD
cc6e2d302f Implement TryGetPath and TryGetNormalisedPath for fonts 2023-03-17 20:28:21 +00:00
Eliot Jones
5eebe9d0f9
Merge pull request #561 from mvantzet/PageSizesAndRotation
Page sizes and rotation
2023-03-17 20:48:32 +01:00
mvantzet
3abb34bfdd Flipped expected and actual values in assert 2023-03-17 19:43:20 +01:00
mvantzet
76ce251a6e
Merge branch 'UglyToad:master' into PageSizesAndRotation 2023-03-17 19:35:55 +01:00
Eliot Jones
cdd6a564cd Merge branch 'master' of github.com:UglyToad/PdfPig 2023-03-17 18:45:29 +01:00
Eliot Jones
4876bfbbd4 tidy up some resharper and github warnings 2023-03-17 18:45:23 +01:00
Eliot Jones
52b99b6816
Merge pull request #557 from UglyToad/functions
Implement pdf functions and add type 0, 2 and 4 function tests
2023-03-17 18:42:41 +01:00
Eliot Jones
333955881f
Merge pull request #553 from DGdev91/master
Add enums for PDF/A-3 a and PDF/A-3 b conformance + optional parameter to set out builder parameters in PdfMerger
2023-03-17 18:35:20 +01:00
Eliot Jones
bd48bbe536
Merge pull request #556 from fnatzke/FixIssue550
Fix for issue #550
2023-03-17 18:30:08 +01:00
Eliot Jones
68c00c9b51
Merge pull request #527 from fnatzke/Issue350-PdfPageBuilder.CopyFrom()_creates_invalid_PDF
Issue350 pdf page builder.copy from() creates invalid pdf
2023-03-17 18:15:06 +01:00
mvantzet
61d7fbf327 and this 2023-03-16 08:40:52 +01:00
mvantzet
f9f271080d Forgot to commit this 2023-03-16 08:37:54 +01:00
mvantzet
9d15930401 Cleaned up usings, log warning when using user space unit other than 1, removed comment 2023-03-15 22:31:31 +01:00
mvantzet
a07fdb8d45 Follow suggestion by @BobLd, added 2 more test cases for if we want to
support more lenient page size parsing in the future.
2023-03-14 12:33:21 +01:00
mvantzet
048caedd64 Reverted change of ModifiedDate (from string to DateTimeOffset) since
according to the PDF reference guide this field can contain anything.
2023-03-14 12:01:24 +01:00
mvantzet
9ff095c516 Fix typo 2023-03-13 18:15:33 +01:00
mvantzet
ea77156eb8 Changes for annotation positions:
- Pass in the initial matrix to the annotation provider, so that it can return
  the correct rectangles / quad points.
- Made a change / extensions to the Annotation class:
  - ModifiedDate is now a DateTimeOffset instead of unparsed string.
    If the string is invalid, ModifiedDate is set to the default value.
  - Added lookup for the "appearance streams"; all the annotations should have
    a "N" (normal) appearance, and optionally have a "R" (roll-over/hover)
    and "D" (down/click) appearance. Did not expose the actual stream objects,
    but added a flag indicating the existence of "R" / "D". At some point
    we can consider doing something with the appearances.
- Changed signature of GetInitialMatrix / ContentStreamProcessor constructor
  from PdfRectangle back to what it was earlier, namely MediaBox and CropBox,
  to prevent accidentally mixing the two up in the caller.
2023-03-13 18:15:24 +01:00
mvantzet
a439b43246 Added integration test for cropped document, and a cropped+rotated document
with an annotation as well.
Added annotations to visual verification test (blue outlines).
2023-03-13 18:08:20 +01:00
mvantzet
17681472cc Also apply optimizations (set sin/cos to integers) for e.g. -270 degrees. 2023-03-13 17:50:58 +01:00
mvantzet
0413f3f1bf Fix related to page sizes / rotation / coordinate transformations (issue 560):
The initial transformation matrix was incorrect, as it translated by the cropbox width/height
instead of by the cropbox left/bottom offsets. Also, it did not translate the results back into
the 1st quadrant so that (0,0) would (again) be the lower left corner origin for the cropped area.
Added unit tests in new file ContentStreamProcessorTests.

EFFECTIVE CHANGES:

- The coordinates used for letters etc. are different now for rotated and/or cropped pages,
  but as those were not very consistent anyway this is probably OK.

- The Page Size (A4, A3, Custom, etc.), Width and Height are now determined by the CropBox,
  not by the MediaBox; the CropBox ultimately determines what you see on screen and is printable.
  If no cropbox is defined in the PDF, it is set to the MediaBox; so in that case it is
  backwards compatible with the old code.

- The Page MediaBox and CropBox properties are no longer rotated according to Page.Rotation.
  The Page Width and Height do take rotation into account (kept it backward compatible).
2023-03-09 16:42:09 +01:00
mvantzet
3a0a6e1411 Resolving page sizes did not work when the page orientation was landscape, or when
side lengths were not integer or off by one. Added unit tests.
2023-03-09 16:09:14 +01:00
BobLD
c56705d4ff Implement pdf functions and add type 0, 2 and 4 function tests 2023-03-08 18:59:16 +00:00
Fred Natzke
65ff0cb54e Fix for issue #550 2023-03-01 12:29:45 +10:00
DGdev91
65e3c77a5c
Merge branch 'UglyToad:master' into master 2023-02-23 02:40:00 +01:00
Eliot Jones
999f9ee7dc
Merge pull request #551 from fnatzke/Issue549
Fix for Issue#549. Skip over Jpg segments rather than use bruce force…
2023-02-18 10:50:44 +00:00
Eliot Jones
761bce8591
Merge pull request #539 from mvantzet/ExtendLetterProperties
Added Letter properties RenderingMode, StrokeColor, FillColor and add…
2023-02-18 10:48:47 +00:00
DGdev91
5a7ed7c9eb PdfMerger: Make possible to override document informations for output document 2023-02-17 00:13:18 +01:00