Commit Graph

1547 Commits

Author SHA1 Message Date
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
DGdev91
1759c235f0 PdfMerger: Add optional parameter to set desired PDF/A standard 2023-02-16 16:00:12 +01:00
DGdev91
3d6a14bea6 Add enums for PDF/A-3 a and PDF/A-3 b compliance 2023-02-16 15:09:26 +01:00
Fred Natzke
3a848c090c Fix for Issue#549. Skip over Jpg segments rather than use bruce force to find segment start marker 2023-02-16 15:55:42 +10:00
Eliot Jones
88aaddcf26
Merge pull request #541 from fnatzke/Fix540
Fix 540 Copy page with inline image.
2023-01-16 15:25:35 -05:00
Fred Natzke
324de1da67 Fix 540 Copy page with inline image. 2023-01-16 14:27:04 +10:00
mvantzet
2acca32987 Added integration test to see if we can detect the presence of invisible text (text rendering mode = Neither),
visible text, the presence of images and the presence of paths.
Certain combinations thereof potentially must be run through OCR.
2023-01-13 14:11:13 +01:00
mvantzet
06253966e4 Added Letter properties RenderingMode, StrokeColor, FillColor and added those as mandatory
constructor arguments. Kept property Color, which contains either StrokeColor (if rendering mode is Stroke)
or FillColor (for all other rendering modes).
In PdfPageBuilder opted for default text rendering mode "Fill" which seems like a sensible default.
2023-01-13 12:35:25 +01:00
Eliot Jones
65bc754f5b remove ci unsupported syntax 2023-01-08 15:38:05 -05:00
Eliot Jones
d5b196ff44 remove unsupported syntax 2023-01-08 14:18:09 -05:00
Eliot Jones
d2944e14e5 change alpha version for nightly builds 2023-01-08 12:01:48 -05:00
Eliot Jones
57e9acbc12 post merge tidy up 2023-01-08 12:00:35 -05:00
Eliot Jones
7b891edb69
Merge pull request #526 from fnatzke/Issue455-Issue_extracting_unicode_from_CJK_file
Fix #455 extracting unicode from CJK file
2023-01-08 11:53:32 -05:00
Eliot Jones
37e31c40ae
Merge pull request #522 from fnatzke/master
Fix #514 Print Character with ZapfDingbats font
2023-01-08 11:52:15 -05:00
Eliot Jones
982f36647a
Merge pull request #525 from mvantzet/ITokenWriter
Make TokenWriter non-static, implement ITokenWriter, injection in PdfDocumentBuilder, add PdfTextRemover
2023-01-08 11:49:56 -05:00
Fred Natzke
210c0dde50 Issue451_Type2CharStrings parsing/intepretation error 2022-12-26 17:08:03 +10:00