AR

Hi Guys,

 

I am generating one word report using script.

I have few models and I want to print the graphic image of one model in word document.

currently I am using this code for printing the image:-

 var modelPicture = obj_conn_model[0].Graphic(false,false,locale);    output.OutGraphic(modelPicture,50,200,385);

//output is reference of createOutputObjects()

here I am giving a fix size of image.

I don't want to do that. because if image size exceeds the page size then it wont give me a proper image.

So I want to print the image in auto adjustable size according to page width and height.

Please help if you can.

 

Thanks,

Ankit

  

 

 

 

by Jef Martens MSc
Posted on Thu, 11/27/2014 - 21:14

Hi Ankit,

While you are creating the setup for the output file, you can also specify the dimensions.

What you can do is define a set of variables such as:

var outputWidth
var outputHeight
var outputMarginLeft
var outputMarginRight
var outputMarginTop
var outputMarginBottom



This particularly will help you in defining your pictureWidth and pictureHeight:

var pictureWidth = (outputWidth - outputMarginLeft - outputMarginRight);
var pictureHeight = ((outputHeight)/2 - outputMarginTop - outputMarginBottom); // half a page height
var zoomLevel = -1; // zoomlevel is determined to match pictureWidth or pictureHeight, whichever is fitting

output.OutGraphic(modelPicture,zoomLevel,pictureWidth,pictureHeight);

Or, alternatively, you can use the OutGrapicAbsolute(picture, int, int, int, int, boolean) function to get absolute control on the size and position.

/**
 From the helpfile: Report class StandardOutputAPI - Method OutGraphicAbsolute
 OutGraphicAbsolute ( Picture p_sPicture, int p_iX1, int p_iY1, int p_iPicWidthMM, int p_iPicHeightMM, boolean p_bBackground )
 Insert a graphic at an absolute position.
 Example
**/

var File = Context.createOutputObject();
var image = Context.createPicture("picture.jpg");
File.OutGraphicAbsolute(image,10, 10, 100, 100, true);
0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock