We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to print or export specific page (muiltpage=true)

Hi there, i have been testing on how to print or export a specific page,  in my test  I have multipage=true pagebreak=true on the diagram component so  i Have 6 pages   3x3   but when i print or export appears the whole diagram so now i want to print specific page or pages lest say  page # 3  or page 4 & 5
this need its cause some diagrams i need to make are very huge so its needed to print on Letter page 1 or 2 page(s) so i can join them later after printed
checking examples & documentation about exporting region also does not well for me perhaps i am doing something wrong.  Also on the part of  printing i set options similar to exporting but does not work.

Can anyone provide an example or piece of code that may work with samples ?
thanks in advance.

1 Reply

SG Shyam G Syncfusion Team June 28, 2017 11:57 AM UTC

Hi Carlos, 
  • Currently we don’t have support to print the specific page in our diagram control.
  • instead we get dataURL from exportDiagram method and convert it into multiple images based on the page size. Later you can print the specific images.
Code example: 
               // get data url 
                var url = diagram.exportDiagram({ 
                    fileName: "diagram", 
                    mode: "data", 
                    format: "png", 
                    pageWidth: 400, 
                    pageHeight: 400, 
                    region: "pageSettings", multiplePage: true 
                  //get multiple image data url 
    var images = getMultipleImage(img, { mode: "data", region: "pageSettings", pageWidth: 400, pageHeight: 400, multiplePage: true, margin: { top: 0, bottom: 0, left: 0, right: 0, } }); 
                   //print specific image 
     PrintWind.document.write('<img src="' + images[1] + '">');   
  • please refer to the JSPlayground link below.
Shyam G 

Live Chat Icon For mobile
Up arrow icon