Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Bug with PDF printing (Read 16433 times)
Patrick Guerin
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Dec 11th, 2014
Bug with PDF printing
Dec 16th, 2014 at 3:56pm
Print Post  
Hi, just to put you in context, I'll give you information about the situation.

We are creating a diagram with  Diagram com.ibm.brmt.pdo.rcp.parts.editors.relation.AbstractFlowChartEditor.diagram

Look at the pdf attached to the following post to see the graph.  Exporting pdf is perfect.  We are able to export the graph and everything is ok.  But each time we try to print this pdf (with the option setAutoScale(AutoScale.FitToWidth)), there is a bug and printing doesn't work.  At first glance, it's seems to be the print server (problem), but each time we export the graph without the font (no text, we remove the text before the exportation of the pdf), everything works perfectly (print).  Writing text in a pdf includes the font inside the pdf.  If we don't scale the graph (fitToWidth), the print works perfectly.  As soon as we combine Font (Text inside Shape) and Scaling (FitToWidth or any type of scaling), the pdf file can be opened, but the printing doesn't work.  I tried to set all the combination of properties inside the PdfExporter Class without success.

We are actually not able to print the attached pdf in this post.

Thanks for help.
  

Graph.pdf (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug with PDF printing
Reply #1 - Dec 17th, 2014 at 2:35pm
Print Post  
This PDF printed correctly for me from Adobe Reader 11.0.10 to Xerox Phaser printer. What OS version, PDF software and printer model are you using?
  
Back to top
 
IP Logged
 
Patrick Guerin
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Dec 11th, 2014
Re: Bug with PDF printing
Reply #2 - Dec 17th, 2014 at 7:14pm
Print Post  
Adobe Reader XI (11.0.10.32).
Windows 7 SP1
Printer is IBM Infoprint Black&White 1145 and IBM Infoprint Color 1357. Both printer doesn't print the page correctly. We print many pdf and many document here (at IBM) without any problem, but for unknown facts, there is a thing inside the pdf (Font + Scalling) that cause an "out of bound" drawing and raise exception on the print server. This is the description of the error code (the printer prints only the data that is inside the valid printable area. In addition, a printer error marker (PEM) is printed on the page where the print data extends outside the valid printable area.)
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug with PDF printing
Reply #3 - Dec 18th, 2014 at 12:18pm
Print Post  
The exporter does not leave any page margin space by default. Does printing work if you set the Margin properties?

Code
Select All
PdfExporter pdf = new PdfExporter();
pdf.setMarginLeft(2);
pdf.setMarginTop(2);
pdf.setMarginRight(2);
pdf.setMarginBottom(2);
pdf.setAutoScale(AutoScale.FitToWidth);
... 

  
Back to top
 
IP Logged
 
Patrick Guerin
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Dec 11th, 2014
Re: Bug with PDF printing
Reply #4 - Dec 18th, 2014 at 2:13pm
Print Post  
Hi, the print still doesn't work, even if I set the margin to anything (I tried many different value without success).  Embarrassed
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug with PDF printing
Reply #5 - Dec 18th, 2014 at 2:45pm
Print Post  
What happens if you enable node.Transparent to hide the graphics and export only text?

Are you using the "Shrink to fit page" option from Reader's print dialog (enabled by default)? I think it should prevent sending coordinates out of page area to the printer.
  
Back to top
 
IP Logged
 
Patrick Guerin
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Dec 11th, 2014
Re: Bug with PDF printing
Reply #6 - Dec 18th, 2014 at 7:45pm
Print Post  
I tried to put node.transparent(true).  All the shape disappear and only the text is exported.  The problem is still there with only the text.  I was thinking that the problems could be in relation with ShapeNode and text inside the node.  I've tried all the possible way to wrap, nowrap the text, show, hide shape, create new node with only text inside.  As soon as I use text inside a node (view or hide) and use the scaling function, the printing step doesn't work. 

I tried every possible option to print in Adobe Acrobat.  Fit, Custom Scale 100%, Scale > 100%, Scale < 100%, Actual size and Shrink oversized page.  Every time, the print doesn't work.  Cry

It's weird !

[12/18/14 14:44:08] 5010-204 Job 276 (brminfo4:1828731588) stopped processing due to job or destination errors.

[12/18/14 14:43:58] 5010-204 Job 275 (brminfo4:1828731587) stopped processing due to job or destination errors.

[12/18/14 14:43:46] 5010-204 Job 274 (brminfo4:1828731586) stopped processing due to job or destination errors.

[12/18/14 14:43:34] 5010-204 Job 273 (brminfo4:1828731585) stopped processing due to job or destination errors.

[12/18/14 14:43:28] 5010-204 Job 272 (brminfo4:1828731584) stopped processing due to job or destination errors.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug with PDF printing
Reply #7 - Dec 19th, 2014 at 11:25am
Print Post  
Does export & print work if you add only an instance of this type to the diagram?

Code
Select All
class ShapeNodeNoClip extends ShapeNode
{
	@Override
	protected void drawLocal(Graphics2D g, RenderOptions options)
	{
		g.setPaint(Color.black);
		g.setFont(new Font("Arial", Font.PLAIN, 4));
		g.drawString("string", 5, 10);
	}

	@Override
	protected void drawShadowLocal(Graphics2D graphics, RenderOptions options)
	{
	}
} 

  
Back to top
 
IP Logged
 
Patrick Guerin
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Dec 11th, 2014
Re: Bug with PDF printing
Reply #8 - Dec 19th, 2014 at 3:21pm
Print Post  
Embarrassed
It's not working.  Look at the pdf attached to the post.  I always get the error during the printing step.

Oufff, not easy... 
  

ShapeNodeNoClip__Output_.pdf (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug with PDF printing
Reply #9 - Dec 19th, 2014 at 5:07pm
Print Post  
Could you try printing these three pdfs?

Code
Select All
try
{
	PdfGraphics2D pdf1 = new PdfGraphics2D(
		new Rectangle2D.Float(), GraphicsUnit.Millimeter);
	pdf1.createPage(new Rectangle2D.Float(0, 0, 800, 1000) /*points*/);
	pdf1.scale(2, 2);
	pdf1.setFont(new Font("Arial", Font.PLAIN, 4));
	pdf1.setPaint(Color.black);
	pdf1.drawString("string", 40, 80);
	pdf1.save("1.pdf");

	PdfGraphics2D pdf2 = new PdfGraphics2D(
		new Rectangle2D.Float(), GraphicsUnit.Millimeter);
	pdf2.createPage(new Rectangle2D.Float(0, 0, 800, 1000) /*points*/);
	pdf2.scale(2, 2);
	pdf2.setPaint(Color.white);
	pdf2.fill(new Rectangle2D.Float(20, 60, 80, 80));
	pdf2.setFont(new Font("Arial", Font.PLAIN, 4));
	pdf2.setPaint(Color.black);
	pdf2.drawString("string", 40, 80);
	pdf2.save("2.pdf");

	PdfGraphics2D pdf3 = new PdfGraphics2D(
		new Rectangle2D.Float(), GraphicsUnit.Millimeter);
	pdf3.createPage(new Rectangle2D.Float(0, 0, 800, 1000) /*points*/);
	pdf3.scale(2, 2);
	pdf3.clip(new Rectangle2D.Float(20, 60, 80, 80));
	pdf3.setPaint(Color.white);
	pdf3.fill(new Rectangle2D.Float(0, 0, 1200, 1200));
	pdf3.setFont(new Font("Arial", Font.PLAIN, 4));
	pdf3.setPaint(Color.black);
	pdf3.drawString("string", 40, 80);
	pdf3.save("3.pdf");
}
catch (Exception ex)
{
} 

  
Back to top
 
IP Logged
 
Patrick Guerin
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Dec 11th, 2014
Re: Bug with PDF printing
Reply #10 - Dec 19th, 2014 at 6:13pm
Print Post  
Hi Stoyo,
All these cases work correctly.

[12/19/14 13:11:23] 5010-071 Job name 3.pdf with ID 280 (brminfo4:1828732170) completed successfully on las2t56a.

[12/19/14 13:15:28] 5010-071 Job name 2.pdf with ID 282 (brminfo4:1828732174) completed successfully on las2t56a.

[12/19/14 13:15:20] 5010-071 Job name 1.pdf with ID 281 (brminfo4:1828732173) completed successfully on las2t56b.

You can see the pdf attached. Do you an idea where the bug could be ?

I show you one more case. Look at the image here, when I create text outside the page (write text with font outside the graph canvas), I get the error (check the quantity to put to get error).

If I put the code line
pdf1.drawString("A A A A A A A A A A A",20,40);
in a specific quantity, it's work.  When I go over this quantity, it doesn't print. 

This is working (33 times)
pdf1.drawString("A A A A A A A A A A A",20,40);
pdf1.drawString("A A A A A A A A A A A",20,50);
pdf1.drawString("A A A A A A A A A A A",20,60);
pdf1.drawString("A A A A A A A A A A A",20,70);
pdf1.drawString("A A A A A A A A A A A",20,80);
pdf1.drawString("A A A A A A A A A A A",20,90);
pdf1.drawString("A A A A A A A A A A A",20,100);
pdf1.drawString("A A A A A A A A A A A",20,110);
pdf1.drawString("A A A A A A A A A A A",20,120);
pdf1.drawString("A A A A A A A A A A A",20,130);
pdf1.drawString("A A A A A A A A A A A",20,140);
pdf1.drawString("A A A A A A A A A A A",20,150);
pdf1.drawString("A A A A A A A A A A A",20,160);
pdf1.drawString("A A A A A A A A A A A",20,170);
pdf1.drawString("A A A A A A A A A A A",20,180);
pdf1.drawString("A A A A A A A A A A A",20,190);
pdf1.drawString("A A A A A A A A A A A",20,200);
pdf1.drawString("A A A A A A A A A A A",20,210);
pdf1.drawString("A A A A A A A A A A A",20,220);
pdf1.drawString("A A A A A A A A A A A",20,230);
pdf1.drawString("A A A A A A A A A A A",20,240);
pdf1.drawString("A A A A A A A A A A A",20,250);
pdf1.drawString("A A A A A A A A A A A",20,260);
pdf1.drawString("A A A A A A A A A A A",20,270);
pdf1.drawString("A A A A A A A A A A A",20,280);
pdf1.drawString("A A A A A A A A A A A",20,290);
pdf1.drawString("A A A A A A A A A A A",20,300);
pdf1.drawString("A A A A A A A A A A A",20,310);
pdf1.drawString("A A A A A A A A A A A",20,320);
pdf1.drawString("A A A A A A A A A A A",20,330);
pdf1.drawString("A A A A A A A A A A A",20,340);
pdf1.drawString("A A A A A A A A A A A",20,350);
pdf1.drawString("A A A A A A A A A A A",20,360);

This is not working (34 times)
pdf1.drawString("A A A A A A A A A A A",20,40);
pdf1.drawString("A A A A A A A A A A A",20,50);
pdf1.drawString("A A A A A A A A A A A",20,60);
pdf1.drawString("A A A A A A A A A A A",20,70);
pdf1.drawString("A A A A A A A A A A A",20,80);
pdf1.drawString("A A A A A A A A A A A",20,90);
pdf1.drawString("A A A A A A A A A A A",20,100);
pdf1.drawString("A A A A A A A A A A A",20,110);
pdf1.drawString("A A A A A A A A A A A",20,120);
pdf1.drawString("A A A A A A A A A A A",20,130);
pdf1.drawString("A A A A A A A A A A A",20,140);
pdf1.drawString("A A A A A A A A A A A",20,150);
pdf1.drawString("A A A A A A A A A A A",20,160);
pdf1.drawString("A A A A A A A A A A A",20,170);
pdf1.drawString("A A A A A A A A A A A",20,180);
pdf1.drawString("A A A A A A A A A A A",20,190);
pdf1.drawString("A A A A A A A A A A A",20,200);
pdf1.drawString("A A A A A A A A A A A",20,210);
pdf1.drawString("A A A A A A A A A A A",20,220);
pdf1.drawString("A A A A A A A A A A A",20,230);
pdf1.drawString("A A A A A A A A A A A",20,240);
pdf1.drawString("A A A A A A A A A A A",20,250);
pdf1.drawString("A A A A A A A A A A A",20,260);
pdf1.drawString("A A A A A A A A A A A",20,270);
pdf1.drawString("A A A A A A A A A A A",20,280);
pdf1.drawString("A A A A A A A A A A A",20,290);
pdf1.drawString("A A A A A A A A A A A",20,300);
pdf1.drawString("A A A A A A A A A A A",20,310);
pdf1.drawString("A A A A A A A A A A A",20,320);
pdf1.drawString("A A A A A A A A A A A",20,330);
pdf1.drawString("A A A A A A A A A A A",20,340);
pdf1.drawString("A A A A A A A A A A A",20,350);
pdf1.drawString("A A A A A A A A A A A",20,360);
pdf1.drawString("A A A A A A A A A A A",20,370);

Thanks again
« Last Edit: Dec 19th, 2014 at 8:03pm by Patrick Guerin »  

Error_PDF.PNG (Attachment deleted)
Back to top
 
IP Logged
 
Patrick Guerin
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Dec 11th, 2014
Re: Bug with PDF printing
Reply #11 - Dec 19th, 2014 at 9:31pm
Print Post  
Other observation, it's seem to have a relation between the printer margin at 100% scale (no scale) and text written inside the margin.  When I scale to fit, graphics appear in the limite of the printable area (it's seem to be ok with the margin), but in fact, at 100% (no scale), the text can be inside the printer margin and the printer fail.  It's probably not just the text, but any shape, node or drawing inside this limite cause the problem.  I'm not 100% sure, but i hope this will help anybody to better understand.
Thank you.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug with PDF printing
Reply #12 - Dec 22nd, 2014 at 9:19am
Print Post  
Hi,

Quote:
All these cases work correctly.


Does this work?

Code
Select All
PdfGraphics2D pdf4 = new PdfGraphics2D(
		new Rectangle2D.Float(), GraphicsUnit.Millimeter);
pdf4.createPage(new Rectangle2D.Float(0, 0, 800, 1000) /*points*/);
pdf4.scale(2, 2);
pdf4.clip(new Rectangle2D.Float(0, 0, 1200, 1200));
pdf4.setPaint(Color.white);
pdf4.fill(new Rectangle2D.Float(0, 0, 1200, 1200));
pdf4.setFont(new Font("Arial", Font.PLAIN, 4));
pdf4.setPaint(Color.black);
pdf4.drawString("string", 40, 80);
pdf4.save("4.pdf"); 



Quote:
I show you one more case.  Look at the image here, when I create text outside the page (write text with font outside the graph canvas), I get the error (check the quantity to put to get error)... It's probably not just the text, but any shape, node or drawing inside this limite cause the problem.


If you export using the default DiagramSize size for PDF page, then in the general case that single PDF page will be larger than a printer's supported page size and will have a graphic element that overlaps the margins and even goes much beyond the paper size (the background rectangle painted with BackBrush that fills diagram.Bounds). So that format is more useful for viewing on screen than printing, unless the diagram isn't much larger than a page and you enable Reader's shrink option.

Have you tried exporting in A4 format with the Margin properties set? If you export to a format that splits the graphics into multiple pages, than the background rectangle and all other graphics elements should be clipped at page boundaries, and since test3 above works that should not cause problems. The exporter creates a PDF rectangle for the whole diagram.Bounds (clipped for each page) in order to show correct parts of images or gradients in pages in case BackBrush is set to corresponding type.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Patrick Guerin
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Dec 11th, 2014
Re: Bug with PDF printing
Reply #13 - Dec 22nd, 2014 at 8:47pm
Print Post  
Hi, the last scenario works.  I tried another scenario, I just wrote the char "M" in the center of the pdf page (letter page).  When I drawString 1 time, it's work perflectly, but at specific number of time (it crashes, just for the printing step).  There is a relation between the number of char, a maximum number of error during the conversion made by the raster image processor (RIP, still not sure what this does, but...)

This is some new clues I got.

The error message : "RIP Failed, the raster image processor (RIP) failed to convert the job".  I read on RIP and it's "Adobe PostScript Raster to Image Transform (RIP) or Raster Image processor.

Really tough !!!!
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug with PDF printing
Reply #14 - Dec 23rd, 2014 at 7:19pm
Print Post  
Graph.pdf also prints successfully to our HP LaserJet. My guess is there's something wrong in the interface between Adobe Reader and your printer driver. Could you check if there's a newer version and update device drivers? What happens if you print graph.pdf to the Windows XPS printer, and then print the XPS file from XPS viewer?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint