Skip to content

Commit 9933f77

Browse files
authored
Merge pull request #8 from synercoder/reorder-pdfpage-fields-and-properties
Reordered PdfPage fields and properties
2 parents 0a21978 + 220795e commit 9933f77

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Synercoding.FileFormats.Pdf/PdfPage.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
using ImageSharp = SixLabors.ImageSharp;
21
using SixLabors.ImageSharp.PixelFormats;
32
using Synercoding.FileFormats.Pdf.Helpers;
43
using Synercoding.FileFormats.Pdf.PdfInternals.Objects;
54
using Synercoding.FileFormats.Pdf.PdfInternals.XRef;
65
using Synercoding.FileFormats.Pdf.Primitives;
76
using Synercoding.FileFormats.Pdf.Primitives.Matrices;
87
using System.Collections.Generic;
9-
using System.Collections.ObjectModel;
108
using System.IO;
9+
using ImageSharp = SixLabors.ImageSharp;
1110

1211
namespace 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

Comments
 (0)