Commit Graph

15 Commits

Author SHA1 Message Date
Jason Nelson
435da86a25 Make QuadPointsQuadrilateral a readonly struct 2024-04-12 07:42:19 +01:00
Jason Nelson
a412a239be
Enable nullable annotations (#803)
* Enable nullable annotations

* Remove unused Jetbrain annotations

* Ensure system using statements are first

* Improve nullability annotations

* Annotate encryptionDictionary is non-null when IsEncrypted is true

* Disable nullable for PdfTokenScanner.Get

* Improve nullability annotations for ObjectLocationProvider.TryGetCached

* Revert changes to RGBWorkingSpace

* Update UglyToad.PdfPig.Package with new framework targets (fixes nightly builds)
2024-03-17 18:51:40 +00:00
BobLd
bf6c519483 Make AnnotationProvider public 2024-03-16 12:50:26 +00:00
BobLd
9f3d2745f6 Change NumericToken from IDataToken<decimal> to IDataToken<double> and fix #765 2024-02-18 14:53:38 +00:00
Eliot Jones
211b27062d support looking up in reply to value for annotation #362 2023-05-27 13:40:01 +01:00
Yufei Huang
3898f09a5f Pdf merger support copy links 2023-04-22 13:54:31 +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
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
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
Eliot Jones
6fdaf054cb remove islenientparsing from annotation provider 2020-02-28 11:39:56 +00:00
Eliot Jones
efc258b0f0 use tokenscanner when converting array to rectangle
an arrray of 4 items representing a rectangle may define its values as indirect references. when converting to a rectangle we pass a pdf token scanner to resolve any indirect references.
2020-01-13 10:20:08 +00:00
Eliot Jones
00bd285262 add support for quadpoints to annotations
highlight, link, strikeout, squiggly and underline annotation types may define a set of quadrilaterals using the quadpoints entry. this defines the regions to show/activate the annotation. the order of points in the quadpoints array does not match the specification so we provide a convenience class to access the point data rather than interpreting it as a rectangle: https://stackoverflow.com/questions/9855814/pdf-spec-vs-acrobat-creation-quadpoints.
2020-01-05 16:23:07 +00:00
Eliot Jones
74774995d6 complete move of truetype, afm and standard14 fonts
the 3 font types mentioned are moved to the new fonts project, any referenced types are moved to the core project. most truetype classes are made public #8.
2020-01-04 22:39:13 +00:00
Eliot Jones
d572af8a52 finish first pass of annotation api 2018-12-22 15:54:32 +00:00
Eliot Jones
a5349dd77a start adding retrieval of annotations 2018-12-20 18:18:32 +00:00