Skip to content

Commit e38cc76

Browse files
michaeldemeyiText-CI
authored andcommitted
Update Javadocs of PdfCanvas#addXobject(PdfXObject, Rectangle) to mention scaling behavior. DEVSIX-2541
Autoported commit. Original commit hash: [85bf9e40a]
1 parent 217cbd6 commit e38cc76

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

itext/itext.kernel/itext/kernel/pdf/canvas/PdfCanvas.cs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,9 +1813,20 @@ public virtual iText.Kernel.Pdf.Canvas.PdfCanvas AddXObject(PdfXObject xObject,
18131813
/// Adds
18141814
/// <c>PdfXObject</c>
18151815
/// to specified rectangle on canvas.
1816+
/// Do note that using this method of adding an XObject <b>will scale</b> the XObject using the width and the height
1817+
/// of the provided Rectangle. If you don't wish to scale the XObject, use
1818+
/// <see cref="AddXObject(iText.Kernel.Pdf.Xobject.PdfXObject, float, float)"/>
1819+
/// ,
1820+
/// <see cref="AddXObject(iText.Kernel.Pdf.Xobject.PdfXObject, float, float, float)"/>
1821+
/// ,
1822+
/// <see cref="AddXObject(iText.Kernel.Pdf.Xobject.PdfXObject, float, float, float, bool)"/>
1823+
/// ,
1824+
/// or
1825+
/// <see cref="AddXObject(iText.Kernel.Pdf.Xobject.PdfXObject, float, float, float, float, float, float)"/>
1826+
/// .
18161827
/// </summary>
1817-
/// <param name="xObject"/>
1818-
/// <param name="rect"/>
1828+
/// <param name="xObject">the XObject to add</param>
1829+
/// <param name="rect">rectangle containing x and y coordinates and scaling information</param>
18191830
/// <returns>current canvas.</returns>
18201831
public virtual iText.Kernel.Pdf.Canvas.PdfCanvas AddXObject(PdfXObject xObject, iText.Kernel.Geom.Rectangle
18211832
rect) {
@@ -2123,10 +2134,10 @@ private iText.Kernel.Pdf.Canvas.PdfCanvas AddForm(PdfFormXObject form, float x,
21232134
/// <summary>
21242135
/// Adds
21252136
/// <c>PdfFormXObject</c>
2126-
/// to specified rectangle on canvas.
2137+
/// to specified rectangle on canvas and scale it using the rectangle's width and height.
21272138
/// </summary>
2128-
/// <param name="form"/>
2129-
/// <param name="rect"/>
2139+
/// <param name="form">PdfFormXObject to add</param>
2140+
/// <param name="rect">rectangle containing x and y coordinates and scaling information</param>
21302141
/// <returns>current canvas.</returns>
21312142
private iText.Kernel.Pdf.Canvas.PdfCanvas AddForm(PdfFormXObject form, iText.Kernel.Geom.Rectangle rect) {
21322143
return AddForm(form, rect.GetWidth(), 0, 0, rect.GetHeight(), rect.GetX(), rect.GetY());
@@ -2227,10 +2238,10 @@ private iText.Kernel.Pdf.Canvas.PdfCanvas AddImage(PdfImageXObject image, float
22272238
/// <summary>
22282239
/// Adds
22292240
/// <c>PdfImageXObject</c>
2230-
/// to specified rectangle on canvas.
2241+
/// to specified rectangle on canvas and scale it using the rectangle's width and height.
22312242
/// </summary>
2232-
/// <param name="image"/>
2233-
/// <param name="rect"/>
2243+
/// <param name="image">PdfImageXObject to add</param>
2244+
/// <param name="rect">rectangle containing x and y coordinates and scaling information</param>
22342245
/// <returns>current canvas</returns>
22352246
private iText.Kernel.Pdf.Canvas.PdfCanvas AddImage(PdfImageXObject image, iText.Kernel.Geom.Rectangle rect
22362247
) {

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fd08e4dc0d15c8afab81ce470e0b39341afda840
1+
85bf9e40a7470200265d0232ce8fd1ee6c945f0d

0 commit comments

Comments
 (0)