~ubuntu-branches/ubuntu/trusty/pdfmod/trusty

« back to all changes in this revision

Viewing changes to lib/PdfSharp/PdfSharp.Pdf/TrimMargins.cs

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2010-06-18 03:44:46 UTC
  • Revision ID: james.westby@ubuntu.com-20100618034446-bogifrsscpayp361
Tags: upstream-0.8.3
ImportĀ upstreamĀ versionĀ 0.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#region PDFsharp - A .NET library for processing PDF
 
2
//
 
3
// Authors:
 
4
//   Stefan Lange (mailto:Stefan.Lange@pdfsharp.com)
 
5
//
 
6
// Copyright (c) 2005-2008 empira Software GmbH, Cologne (Germany)
 
7
//
 
8
// http://www.pdfsharp.com
 
9
// http://sourceforge.net/projects/pdfsharp
 
10
//
 
11
// Permission is hereby granted, free of charge, to any person obtaining a
 
12
// copy of this software and associated documentation files (the "Software"),
 
13
// to deal in the Software without restriction, including without limitation
 
14
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
15
// and/or sell copies of the Software, and to permit persons to whom the
 
16
// Software is furnished to do so, subject to the following conditions:
 
17
//
 
18
// The above copyright notice and this permission notice shall be included
 
19
// in all copies or substantial portions of the Software.
 
20
//
 
21
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
22
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
23
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 
24
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
25
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
26
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 
27
// DEALINGS IN THE SOFTWARE.
 
28
#endregion
 
29
 
 
30
using System;
 
31
using System.Diagnostics;
 
32
using System.Collections;
 
33
using System.Text;
 
34
using PdfSharp.Drawing;
 
35
 
 
36
namespace PdfSharp.Pdf
 
37
{
 
38
  /// <summary>
 
39
  /// Represents trim margins added to the page.
 
40
  /// </summary>
 
41
  [DebuggerDisplay("(Left={left.Millimeter}mm, Right={right.Millimeter}mm, Top={top.Millimeter}mm, Bottom={bottom.Millimeter}mm)")]
 
42
  public sealed class TrimMargins
 
43
  {
 
44
    ///// <summary>
 
45
    ///// Clones this instance.
 
46
    ///// </summary>
 
47
    //public TrimMargins Clone()
 
48
    //{
 
49
    //  TrimMargins trimMargins = new TrimMargins();
 
50
    //  trimMargins.left = this.left;
 
51
    //  trimMargins.top = this.top;
 
52
    //  trimMargins.right = this.right;
 
53
    //  trimMargins.bottom = this.bottom;
 
54
    //  return trimMargins;
 
55
    //}
 
56
 
 
57
    /// <summary>
 
58
    /// Sets all four crop margins simultaneously.
 
59
    /// </summary>
 
60
    public XUnit All
 
61
    {
 
62
      set
 
63
      {
 
64
        this.left = value;
 
65
        this.right = value;
 
66
        this.top = value;
 
67
        this.bottom = value;
 
68
      }
 
69
    }
 
70
 
 
71
    /// <summary>
 
72
    /// Gets or sets the left crop margin.
 
73
    /// </summary>
 
74
    public XUnit Left
 
75
    {
 
76
      get { return this.left; }
 
77
      set { this.left = value; }
 
78
    }
 
79
    XUnit left;
 
80
 
 
81
    /// <summary>
 
82
    /// Gets or sets the right crop margin.
 
83
    /// </summary>
 
84
    public XUnit Right
 
85
    {
 
86
      get { return this.right; }
 
87
      set { this.right = value; }
 
88
    }
 
89
    XUnit right;
 
90
 
 
91
    /// <summary>
 
92
    /// Gets or sets the top crop margin.
 
93
    /// </summary>
 
94
    public XUnit Top
 
95
    {
 
96
      get { return this.top; }
 
97
      set { this.top = value; }
 
98
    }
 
99
    XUnit top;
 
100
 
 
101
    /// <summary>
 
102
    /// Gets or sets the bottom crop margin.
 
103
    /// </summary>
 
104
    public XUnit Bottom
 
105
    {
 
106
      get { return this.bottom; }
 
107
      set { this.bottom = value; }
 
108
    }
 
109
    XUnit bottom;
 
110
 
 
111
    /// <summary>
 
112
    /// Gets a value indicating whether this instance has at least one margin with a value other than zero.
 
113
    /// </summary>
 
114
    public bool AreSet
 
115
    {
 
116
      get { return this.left.Value != 0 || this.right.Value != 0 || this.top.Value != 0 || this.bottom.Value != 0; }
 
117
    }
 
118
  }
 
119
}
 
 
b'\\ No newline at end of file'