Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Printing Diagrams (Read 4553 times)
Al
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Sep 3rd, 2014
Printing Diagrams
Sep 9th, 2014 at 1:56pm
Print Post  
Obviously it is possible to print straight from the browser but then you get scroll bars, URL etc. on the page too - is it possible just print the diagram portion?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Printing Diagrams
Reply #1 - Sep 9th, 2014 at 3:53pm
Print Post  
Try this method:

Code
Select All
function print()
{
	var printWindow = window.open();
	var img = printWindow.document.createElement("img");
	img.src = document.getElementById("diagram").toDataURL("image/png");
	printWindow.document.body.appendChild(img);
	printWindow.print();
	printWindow.close();
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Al
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Sep 3rd, 2014
Re: Printing Diagrams
Reply #2 - Sep 10th, 2014 at 7:36am
Print Post  
Brilliant, thanks
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: Printing Diagrams
Reply #3 - Sep 4th, 2019 at 8:22am
Print Post  
With below code, it is printing sometime and somtime gets blank. why it is happening so. Please tell me.

Stoyo wrote on Sep 9th, 2014 at 3:53pm:
Try this method:

Code
Select All
function print()
{
	var printWindow = window.open();
	var img = printWindow.document.createElement("img");
	img.src = document.getElementById("diagram").toDataURL("image/png");
	printWindow.document.body.appendChild(img);
	printWindow.print();
	printWindow.close();
} 



I hope that helps,
Stoyan

  
Back to top
AIM  
IP Logged
 
Kannan Thirumal
Senior Member
****
Offline


I Love Mind Fusion Diagram
:-)

Posts: 270
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: Printing Diagrams
Reply #4 - Sep 4th, 2019 at 11:32am
Print Post  
I guess the image is not yet loaded. Please check this.

https://mindfusion.eu/Forum/YaBB.pl?num=1547792559/17#17
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: Printing Diagrams
Reply #5 - Sep 5th, 2019 at 3:56am
Print Post  
Thanks for the reply,
please can you tell me how can I define this event in html ?
"printDiagramClick"?
  
Back to top
AIM  
IP Logged
 
Kannan Thirumal
Senior Member
****
Offline


I Love Mind Fusion Diagram
:-)

Posts: 270
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: Printing Diagrams
Reply #6 - Sep 5th, 2019 at 6:50am
Print Post  
I've used a button. You can define however you need.


// In .html file . . .
<button id="printDiagram" (click)="printDiagramClick($event)">Print Diagram</button>

// In .ts file . . .
  private printDiagramClick(): void {

  }
  
Back to top
 
IP Logged
 
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
Re: Printing Diagrams
Reply #7 - Sep 5th, 2019 at 10:13am
Print Post  
Tried the same, but in this case, new blank window opens and getting message in pop up "
Picture Printing is not available without the Desktop Experience Feature." Can you help me in this?
  
Back to top
AIM  
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Printing Diagrams
Reply #8 - Sep 5th, 2019 at 10:18am
Print Post  
Hi,

Please see my response to the same issue here: https://mindfusion.eu/Forum/YaBB.pl?num=1547792559/27#27.

Regards,
Lyubo,
MindFusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint