1- using ImageSharp = SixLabors . ImageSharp ;
21using SixLabors . ImageSharp . PixelFormats ;
32using Synercoding . FileFormats . Pdf . Helpers ;
43using Synercoding . FileFormats . Pdf . PdfInternals . Objects ;
54using Synercoding . FileFormats . Pdf . PdfInternals . XRef ;
65using Synercoding . FileFormats . Pdf . Primitives ;
76using Synercoding . FileFormats . Pdf . Primitives . Matrices ;
87using System . Collections . Generic ;
9- using System . Collections . ObjectModel ;
108using System . IO ;
9+ using ImageSharp = SixLabors . ImageSharp ;
1110
1211namespace Synercoding . FileFormats . Pdf
1312{
@@ -17,33 +16,34 @@ public class PdfPage
1716 private readonly Dictionary < string , Image > _images = new Dictionary < string , Image > ( ) ;
1817 private readonly TableBuilder _tableBuilder ;
1918
19+ private Rectangle _trimBox = Rectangle . Zero ;
20+ private Rectangle _bleedBox = Rectangle . Zero ;
21+ private Rectangle _cropBox = Rectangle . Zero ;
22+
2023 internal PdfPage ( TableBuilder tableBuilder )
2124 {
2225 _tableBuilder = tableBuilder ;
2326 ContentStream = new ContentStream ( tableBuilder . ReserveId ( ) ) ;
2427 }
2528
26- internal IReadOnlyDictionary < string , Image > Images { get { return new ReadOnlyDictionary < string , Image > ( _images ) ; } }
29+ internal IReadOnlyDictionary < string , Image > Images => _images ;
2730
2831 internal ContentStream ContentStream { get ; }
2932
3033 public Rectangle MediaBox { get ; set ; } = Sizes . A4Portrait ;
3134
32- private Rectangle _cropBox = Rectangle . Zero ;
3335 public Rectangle CropBox
3436 {
3537 get => _cropBox . Equals ( Rectangle . Zero ) ? MediaBox : _cropBox ;
3638 set => _cropBox = value ;
3739 }
3840
39- private Rectangle _bleedBox = Rectangle . Zero ;
4041 public Rectangle BleedBox
4142 {
4243 get => _bleedBox . Equals ( Rectangle . Zero ) ? CropBox : _bleedBox ;
4344 set => _bleedBox = value ;
4445 }
4546
46- private Rectangle _trimBox = Rectangle . Zero ;
4747 public Rectangle TrimBox
4848 {
4949 get => _trimBox . Equals ( Rectangle . Zero ) ? CropBox : _trimBox ;
@@ -100,7 +100,7 @@ private string _addImageToResources(ImageSharp.Image<Rgba32> image, bool clone)
100100 var key = "Im" + System . Threading . Interlocked . Increment ( ref _pageCounter ) . ToString ( ) . PadLeft ( 6 , '0' ) ;
101101 var id = _tableBuilder . ReserveId ( ) ;
102102
103- if ( clone )
103+ if ( clone )
104104 {
105105 image = image . Clone ( ) ;
106106 }
0 commit comments