Hi Thomas,
I'm doing some tests drawing xform inside another xform. Do you see any issue using that approach as a workaround?
Code:
var pdfDocument = new PdfDocument();
// Inner Pdf Form
var innerForm = new XForm(pdfDocument, XUnit.FromCentimeter(21), XUnit.FromCentimeter(21));
var innerFormGfx = XGraphics.FromForm(innerForm);
using (XImage image = XImage.FromFile(...))
{
.....
innerFormGfx.DrawImage(image, 0, 0, width, height);
}
// Outer Pdf Form
var outerForm = new XForm(pdfDocument, XUnit.FromCentimeter(21), XUnit.FromCentimeter(21));
var outerFormGfx = XGraphics.FromForm(outerForm);
outerFormGfx.DrawImage(innerForm, -200, -200, outerForm.PixelWidth, outerForm.PixelHeight);
// PDF PAGE
var pdfPage = pdfDocument.AddPage();
pdfPage.Width = XUnit.FromCentimeter(42);
pdfPage.Height = XUnit.FromCentimeter(42);
var coef = 2;
var gfx = XGraphics.FromPdfPage(pdfPage);
gfx.DrawImage(outerForm, 50, 50, outerForm.PixelWidth * coef, (double)outerForm.PixelHeight * coef);
pdfDocument.Save(pdfPath);
The idea of using -200, -200 when drawing onto the outerForm is to simulate srcRect i.e. drawing just part of the form.
Alex