mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 19:54:52 +08:00
make cropbox public
This commit is contained in:
@@ -1,20 +1,30 @@
|
||||
namespace UglyToad.PdfPig.Content
|
||||
{
|
||||
using System;
|
||||
using Geometry;
|
||||
using Util.JetBrains.Annotations;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the visible region, contents expanding beyond the crop box should be clipped.
|
||||
/// Defines the visible region of a page, contents expanding beyond the crop box should be clipped.
|
||||
/// </summary>
|
||||
internal class CropBox
|
||||
public class CropBox
|
||||
{
|
||||
[NotNull]
|
||||
/// <summary>
|
||||
/// Defines the clipping of the content when the page is displayed or printed. The page's contents are to be clipped (cropped) to this rectangle
|
||||
/// and then imposed on the output medium.
|
||||
/// </summary>
|
||||
public PdfRectangle Bounds { get; }
|
||||
|
||||
public CropBox(PdfRectangle? bounds)
|
||||
/// <summary>
|
||||
/// Create a new <see cref="CropBox"/>.
|
||||
/// </summary>
|
||||
public CropBox(PdfRectangle bounds)
|
||||
{
|
||||
Bounds = bounds ?? throw new ArgumentNullException(nameof(bounds));
|
||||
Bounds = bounds;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return Bounds.ToString();
|
||||
}
|
||||
}
|
||||
}
|
@@ -27,9 +27,12 @@
|
||||
/// </summary>
|
||||
public int Number { get; }
|
||||
|
||||
internal MediaBox MediaBox { get; }
|
||||
/// <summary>
|
||||
/// Defines the visible region of the page, content outside the <see cref="CropBox"/> is clipped/cropped.
|
||||
/// </summary>
|
||||
public CropBox CropBox { get; }
|
||||
|
||||
internal CropBox CropBox { get; }
|
||||
internal MediaBox MediaBox { get; }
|
||||
|
||||
internal PageContent Content { get; }
|
||||
|
||||
|
@@ -138,7 +138,6 @@
|
||||
|
||||
private PageContent GetContent(IReadOnlyList<byte> contentBytes, CropBox cropBox, UserSpaceUnit userSpaceUnit, PageRotationDegrees rotation, bool isLenientParsing)
|
||||
{
|
||||
var txt = OtherEncodings.BytesAsLatin1String(contentBytes);
|
||||
var operations = pageContentParser.Parse(new ByteArrayInputBytes(contentBytes));
|
||||
|
||||
var context = new ContentStreamProcessor(cropBox.Bounds, resourceStore, userSpaceUnit, rotation, isLenientParsing, pdfScanner,
|
||||
|
Reference in New Issue
Block a user