Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Export to pdf fails with non-printing characters (Read 4072 times)
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 136
Location: England
Joined: Oct 23rd, 2006
Export to pdf fails with non-printing characters
Aug 28th, 2018 at 9:47am
Print Post  
When I export a chart to pdf and one of the chart boxes contains bullet point characters that came from a MS Word document, then the whole program shuts down without even an exception to catch. Code is:

var pdf = new PdfExporter();

try
{
pdf.Export(FlowChart, dlg.FileName);
}

catch (Exception ex)
{
MessageBox.Show(this, "Failed to export file, error is: " + ex.Message, "Error Message",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}

I can't paste in the offending text, but a screenshot is attached
David L

  

Capture_007.PNG ( 6 KB | 181 Downloads )
Capture_007.PNG
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Export to pdf fails with non-printing characters
Reply #1 - Aug 28th, 2018 at 12:02pm
Print Post  
Hi,

I wasn't able to reproduce this with default settings and a node containing Unicode bullet characters • (U+2022).

Could you please attach here a diagram xml containing a node with such text that causes the crash here or mail it at support@mindfusion.eu, so that we can investigate.

Regards,
Lyubo
  

bullets.pdf ( 262 KB | 178 Downloads )
bullets.png ( 7 KB | 175 Downloads )
bullets.png
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 136
Location: England
Joined: Oct 23rd, 2006
Re: Export to pdf fails with non-printing characters
Reply #2 - Aug 28th, 2018 at 1:18pm
Print Post  
Interestingly it seems to be a different type of bullet point that is the problem.  Word document attached containing the problem character.  Paste this text into a ShapeNode and export as pdf. There is a long pause and the program shuts down.

DavidL
  

Test1.docx ( 12 KB | 178 Downloads )
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Export to pdf fails with non-printing characters
Reply #3 - Aug 28th, 2018 at 2:17pm
Print Post  
Hi,

We were able to reproduce the issue with the bullets in the attached file. Our developer will investigate what's going wrong.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Export to pdf fails with non-printing characters
Reply #4 - Aug 30th, 2018 at 5:11am
Print Post  
Hi,

Try setting the default exporter encoding to Unicode and the bullet characters should export without errors. You will need to also set the AutoDetectEncoding flag to false:

Code
Select All
PdfExporter pdfExp = new PdfExporter();
pdfExp.AutoDetectEncoding = false;
pdfExp.DefaultEncoding = System.Text.Encoding.Unicode;
pdfExp.Export(diagramView1.Diagram, saveFileDialog.FileName); 



Regards,
Lyubo
« Last Edit: Aug 30th, 2018 at 7:30am by Lyubo »  

bullets_001.png ( 3 KB | 163 Downloads )
bullets_001.png
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 136
Location: England
Joined: Oct 23rd, 2006
Re: Export to pdf fails with non-printing characters
Reply #5 - Sep 8th, 2018 at 11:37am
Print Post  
No crash this time, but viewing the pdf in my default pdf viewer (MS Edge) shows all characters as blocks. Screenshot attached.  Sorry for delay in replying - does the 'Check this if you want to be informed...' feature work?


DavidL
  

Capture_008.PNG ( 33 KB | 182 Downloads )
Capture_008.PNG
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Export to pdf fails with non-printing characters
Reply #6 - Sep 10th, 2018 at 10:52am
Print Post  
Hi,

It seems Edge has indeed some trouble displaying this text with Unicode encoding. Other pdf viewers under the same system don't seem to have that problem. We will investigate why this happens, in the mean time you can try replacing the square bullet with a regular one before export and reverting to the default encoding settings:

Code
Select All
foreach (DiagramNode node in diagram1.Nodes)
{
    if (!(node is ShapeNode))
        continue;
    var snode = node as ShapeNode;
    if (snode.Text.Contains("\u25AA"))
        snode.Text = snode.Text.Replace('\u25AA', '\u2022');
} 



About the forum notifications, it seems they broke with a update of our hoster's Perl version some time ago, so that feature doesn't work at the moment.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 136
Location: England
Joined: Oct 23rd, 2006
Re: Export to pdf fails with non-printing characters
Reply #7 - Sep 11th, 2018 at 9:38am
Print Post  
There are two other types of bullet point that cause the same problem. Maybe there are other characters as well. I'll wait for a more robust solution.

Thanks
DavidL
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint