Apitron.PDF.Kit library for .NET
Assembly: Apitron.PDF.Kit (in Apitron.PDF.Kit.dll) Version: 2.0.37.0 (2.0.37.0)
The correspondence between image space and user space is constant: the unit square of user space, bounded by user coordinates
(0, 0) and (1, 1), corresponds to the boundary of the image in image space. Following the normal convention for user space,
the coordinate (0, 0) is at the lower-left corner of this square, corresponding to coordinates (0, h) in image space.
The implicit transformation from image space to user space, if specified explicitly, would be described by the matrix [1⁄w 0 0 -1⁄h 0 1].
So, before append image into the content should be modified transformation matrix
Appends the XObject.
Namespace: Apitron.PDF.Kit.FixedLayout.Content
Assembly: Apitron.PDF.Kit (in Apitron.PDF.Kit.dll) Version: 2.0.37.0 (2.0.37.0)
Syntax
Parameters
- resourceID
- Type: SystemString
The resource ID or path to the image file.
Remarks
Examples
C#
// register our image as a resource FixedLayout.Resources.XObjects.Image image = new FixedLayout.Resources.XObjects.Image("Image1", "image.jpg"); document.ResourceManager.RegisterResource(image); // add page Page page = new Page(new PageBoundary(Boundaries.A4)); // add clipped content object ClippedContent clippedContent = new ClippedContent(50, 50, (Boundaries.A4).Width - 50, (Boundaries.A4).Height -50); // add transformation and append our XObject clippedContent.ModifyCurrentTransformationMatrix((Boundaries.A4).Width - 50, 0, 0, (Boundaries.A4).Height - 50, 0, 0); clippedContent.AppendXObject("Image1"); // append clipped content and include page into the document page.Content.AppendContent(clippedContent); document.Pages.Add(page);
See Also