Hi!
I'm not sure if it is bug, or I'm doing something wrong.
I have a RadDocument-object. When I try to add a picture in the back und export it to a PDF the property RelativeFrom of VerticalPosition doesn't work as expected when it is set to VerticalRelativeFrom.Page.
I'm not sure if it is bug, or I'm doing something wrong.
I have a RadDocument-object. When I try to add a picture in the back und export it to a PDF the property RelativeFrom of VerticalPosition doesn't work as expected when it is set to VerticalRelativeFrom.Page.
private
void
Pic2PDF()
{
var doc =
new
Telerik.Windows.Documents.Model.RadDocument();
var stream =
new
FileStream(
"C:\\temp\\test.pdf"
, FileMode.Create);
var pdfExp =
new
Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider();
var pic =
new
FileStream(
"C:\\temp\\picture.jpg"
, FileMode.Open);
var image =
new
Telerik.Windows.Documents.Model.FloatingImageBlock(pic,
new
Size(150, 150),
"jpg"
);
image.AllowOverlap =
true
;
image.WrappingStyle = Telerik.Windows.Documents.Model.WrappingStyle.BehindText;
image.HorizontalPosition =
new
Telerik.Windows.Documents.Model.FloatingBlockHorizontalPosition(Telerik.Windows.Documents.Model.FloatingBlocks.HorizontalRelativeFrom.Page, 250);
image.VerticalPosition =
new
Telerik.Windows.Documents.Model.FloatingBlockVerticalPosition(Telerik.Windows.Documents.Model.FloatingBlocks.VerticalRelativeFrom.Page, 250);
// if I uncomment the next line it works
//image.VerticalPosition.RelativeFrom = Telerik.Windows.Documents.Model.FloatingBlocks.VerticalRelativeFrom.Paragraph;
doc.InsertInline(image);
pdfExp.Export(doc, stream);
}