Article | 70002300 |
Type | HowTo |
Product | WebJS |
Version | 10 |
Date Added | 1/24/2023 12:00:00 AM |
Fixed | 10.1003.0.1 (1/24/2023 12:00:00 AM) |
Submitted by | Rodolfo Ruiz |
Summary
How to improve Vds image object quality
Solution
By default when exporting a drawing to a vds the size of images reduced to fit = in a 552.960 pixels ( 2.211.840 bytes)
This is done in order to keep the file size small and also the memory that will be used by the browser to draw the image inside the webcontrol
You can change this by using the ExportScript and setting the 6th element of the passed parameters element as follow:
bool success2 = vdDocumentComponent1.Document.ExportScript(pathDrawingsServer + “filename" + ".vds", null, new object[] { selected, 4,null,true,null,65000000});
65000000 is the maximum size in pixels for each image
You can also try to use the half image size 32000000 in order to reduce the vds file size and also the memory that will be used by the the browser to load the file
Also you must change your script in the html page before open a vds file using the webcontrol –or- in the initialize of the webcontrol in your html page as follow:
var vdcanvas;
function vdrawInitPageLoad() {
vdcanvas = vdmanager.AttachCanvas('canvas');
vdcanvas.MaxImageSize = 65000000; //Note it is not necessary to be same as ExportScript it can also be smaller (example: 32000000) this will reduce the memory used and the drawing time of the images
}