The HOPAGetPrint4Object function prepares printout image in separate window. The image is presented in 100% scale, but is prepared in full printer resolution.
Parameters of the HOPAGetPrint4Object function allows you control:
page setup and print layout by choosing desired print template,
automatic or user-defined choice of document scale,
part of the original document used to prepare image,
mask unnecessary parts of the document,
contents of user-definable macros;
multi-image printouts with several images composed on a single page.
... <script Language="JScript"> function printMyImage() { window.open (“HOPAGetPrint4Object.asp? ObjClass=Floors& ID=Floor001& Scale=500& UseView=0& PrintTemplate=PRINT-A4& Orientation=L”); } </script> ... <button onclick="printMyImage()">Print</button> ...
This example shows how to perform printing. There is a button (“Print”) on a page. Clicking it causes new browser window to open. This window will contain page with full drawing (UseView=0) in scale 1:500 (Scale=500) ready for printing. Printing will be performed using “PRINT-A4” template in landscape orientation.
... <script Language="JScript"> function printMyImage() { window.open (“HOPAGetPrint4Object.asp? PrintTemplate=PRINT3-A4& Orientation=L& Define_CompanyName=Web2Web%20Inc& ObjClass1=Rooms& ID1=Room002& Scale1=100& MaskMode1=2& SpotMarginPercent1=120& ObjClass2=Rooms& ID2=Room002& UseView2=0& Scale2=1000& ObjClass3=Floors& ID3=Floor001& ScaleMode3=1& SpotMarginPercent3=120”); } </script> ... <button onclick="printMyImage()">Print</button> ...
This advanced example shows how to print using multiple viewports. Printing will be performed using “PRINT3-A4” template that contains three viewports. This template contains macro with dynamic text “!CompanyName” that will be expanded to text “Web2Web Inc”. (Other macros are internally resolved to room name, floor name and building name). Parameters specific for individual viewports are indexed with “1”, “2” and “3”, respectively.
In first viewport, described with text “Consultants room”, object “Room002” from class “Rooms” is displayed in scale 1:100 with view defined for spot linked to that room and with spot margin percent 20% using masking derived from spot shape (“MaskMode1=2”).
In second viewport, the same document is displayed but with full view (“UseView2=0”) and with scale 1:1000, giving overall view on the whole floor with room under interest displayed in yellow color.
In third viewport, document for spot linked to the object “Floor001” is displayed with spot margin percent 20% and scale calculated to fit spot view in viewport (“ScaleMode3=1”).