Hi all,
gfx->Transformer->WorldToDefaultPage(xrect) will fail if you change the size (for example height) after creating Page:
Code:
page->Height=600;
PdfSharp::Drawing::XRect xrect = gfx->Transformer->WorldToDefaultPage(PdfSharp::Drawing::XRect(10, 10, 10 + 50, 10 + 50));
PdfSharp::Pdf::PdfRectangle^ myrec = gcnew PdfSharp::Pdf::PdfRectangle(xrect);
page->AddFileLink(myrec, filename);
WorldToDefaultPage sets Y to a higher value then the Page is, as workaround i create a dummypage, setting width/height on it and use it as template (page = document->AddPage(dummypage)).