Hello Ertuğrul,
please see the example below.
Suppose you have a catalog "Products" and the image is stored in the "DataPicture" attribute (screenshot 1).
We also have a SpreadsheetDocument that has an Image element named D2 (screenshot 2). In this case, the source code for printing the image will look like this:
Code |
---|
&AtClient
Procedure cmdPrint(Command)
PrintDocument = PrintAtServer();
PrintDocument.Show(PrintDocument);
EndProcedure
&AtServer
Function PrintAtServer()
PrintDocument = New SpreadsheetDocument;
Template = Catalogs.Products.GetTemplate("Template");
PictureArea = Template.GetArea("PictureArea");
Picture = New Picture(Object.Ref.DataPicture.Get());
PictureArea.Drawings.D2.Picture = Picture;
PrintDocument.Put(PictureArea);
Return PrintDocument;
EndFunction
|
The attachment also contains dt file with an example.