Java 7, Print to PDF not recognising fonts Mac OS X

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

Java 7, Print to PDF not recognising fonts Mac OS X

Postby swingman » Mon Feb 04, 2013 5:05 pm

Hi all,

Servoy 6.1.3, Mac OS X 10.6.8 / 10.7.x / 10.8.2. Latest Java 7 on server and client. We try to print an invoice. Invoice previews fine in Servoy with proper fonts. We click save as PDF or view as PDF in Preview. resulting invoice has bad bit-mapped font. Has anyone seen this issue?

Christian
Attachments
Screen Shot 2013-02-04 at 15.05.52.png
Screen Shot 2013-02-04 at 15.05.52.png (9.27 KiB) Viewed 2887 times
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1157
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby swingman » Mon Feb 04, 2013 5:08 pm

Should look more like this:
Attachments
Screen Shot 2013-02-04 at 15.07.15.png
Screen Shot 2013-02-04 at 15.07.15.png (12.03 KiB) Viewed 2885 times
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1157
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby Harjo » Mon Feb 04, 2013 5:11 pm

How are you printing that invoice? print-preview? smart-client? web-client? just a form in Servoy?

With pdf-print, you can embed the font (look for the pdf options, in the pdf_output plugin in Servoy)
Harjo Kompagnie
Direct ICT / Servoy Hosting / ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
User avatar
Harjo
 
Posts: 4265
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby swingman » Mon Feb 04, 2013 5:13 pm

Smart Client, Print Preview, Click 'Print Button', get Apple's Print Dialog, PDF Dropdown, Save as PDF or Open PDF in Preview...
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1157
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby Harjo » Mon Feb 04, 2013 5:26 pm

so in the print-preview you see the right font?
that's strange.... that means, the font is recognized (locally) by Servoy.

You didn't had this with Java 6?
Harjo Kompagnie
Direct ICT / Servoy Hosting / ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
User avatar
Harjo
 
Posts: 4265
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby pavelzver » Mon Feb 04, 2013 6:16 pm

Hi,

I have the same issue with Java 7 on Mac OS X. Fonts showing up properly on the print preview, but they do not print the same way. Everything was fine with the previous versions of java.

Does any one have any suggestions?
pavelzver
 
Posts: 38
Joined: Fri Aug 20, 2004 12:01 am

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby swingman » Mon Feb 04, 2013 7:17 pm

Harjo wrote:so in the print-preview you see the right font?
that's strange.... that means, the font is recognized (locally) by Servoy.

You didn't had this with Java 6?


No, it was working fine before on Java 6.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1157
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby Harjo » Tue Feb 05, 2013 12:09 am

Please, file a bug report in the Servoy Support system
User avatar
Harjo
 
Posts: 4265
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby swingman » Fri May 24, 2013 4:21 pm

Any news on this? We have the same problem on Java 7 latest, Mac OS X latest, Servoy 6.1 latest.
We work around by printing to PDF and emailing them to the users.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1157
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby Gordon McLean » Wed Aug 13, 2014 10:45 am

swingman wrote:Any news on this? We have the same problem on Java 7 latest, Mac OS X latest, Servoy 6.1 latest.
We work around by printing to PDF and emailing them to the users.


Did you make any further progress on this Christian ? The fonts are not working either as a print or pdf regardless of how I try and output from Servoy directly. I am looking at moving it to Velocity to overcome the problem but that is going to add a fair amount of work generating the template :(

Cheers
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 191
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby swingman » Tue Aug 19, 2014 7:10 pm

Hi Gordon,

just looked at the production code and we are still sending ourselves PDFs to get around the issue.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1157
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby Gordon McLean » Tue Aug 19, 2014 8:36 pm

swingman wrote:Hi Gordon,

just looked at the production code and we are still sending ourselves PDFs to get around the issue.


Hi Christian

Thanks and interesting, I tried this and the PDFs also failed to render the fonts on the Mac. As it was a relatively simple single page report I re worked it in html using velocity which was fine printed but again as a PDF it lost the fonts :( I am guessing this is the PDF rendering in the java component - none the less a workaround has saved the day :)

Thanks
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 191
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby Harjo » Wed Aug 20, 2014 10:35 am

I have tested this, and this indeed happens, when you set the Servoy client, to use the system print dialog.
Schermafbeelding 2014-08-20 om 10.21.05.png
Schermafbeelding 2014-08-20 om 10.21.05.png (87.16 KiB) Viewed 1949 times


I wondered why we never had complaints about this, and this is because we print the form, directly to pdf (with embedding fonts) inside Servoy and show it as a popup.
Did you already filled a case?? if so please let me know, I will vote for it.
Although I wonder if Servoy can do something about it, because when you don't Save as PDF or Open PDF in Preview... but directly print it the printer, the right fonts are shown on the print.

this is snippet of the code we use

Code: Select all
/**
* @properties={typeid:24,uuid:"49aafa02-acfd-4eb7-aa8b-7708ca5cbcfa"}
* @param {String} form
* @param {String} sendfilename
* @param {Boolean} [vCurrentRecordOnly]
*/
function printAsPdf(form, sendfilename, vCurrentRecordOnly) {
   if (!vCurrentRecordOnly) {
      vCurrentRecordOnly = false
   }
   //only allow characters
   var regExp = /[^a-zA-Z0-9_]/g
   var filename = sendfilename.replace(regExp, '');
   application.output(new Date())
   plugins.pdf_output.startMetaPrintJob()
   if (utils.stringMiddle(application.getOSName(), 1, 7) == "Windows") {
      plugins.pdf_output.insertFontDirectory('c:/Windows/Fonts');
   }

   if (application.getOSName().match("Mac")) {
      //plugins.pdf_output.insertFontDirectory('/System/Library/Fonts/');
      plugins.pdf_output.insertFontDirectory('/Library/Fonts/');
      //plugins.pdf_output.insertFontDirectory('~/Library/Fonts/');
   }
   forms[form].controller.print(vCurrentRecordOnly, false, plugins.pdf_output.getPDFPrinter());
   var pdf = plugins.pdf_output.endMetaPrintJob()
   
   var question = plugins.dialogs.showQuestionDialog('i18n:1.question', 'i18n:1.message.openorsavepdf', 'i18n:1.open', 'i18n:1.saveas')
   if (question == i18n.getI18NMessage('i18n:1.open')) {
      var filenames = plugins.file.createTempFile(filename, '.pdf')
      plugins.file.writeFile(filenames, pdf);
      openFile(filenames.getAbsolutePath())
   } else {
      var save = plugins.file.showFileSaveDialog(filename + '.pdf')
      if (save) {
         var success = plugins.file.writeFile(save, pdf);
         if (success) {
            plugins.dialogs.showInfoDialog('i18n:1.info', 'i18n:1.message.downloadsaveready', 'i18n:1.ok');
         } else {
            plugins.dialogs.showErrorDialog('i18n:1.error', 'i18n:1.message.downloadsaveerror', 'i18n:1.ok');
         }
      }
   }
}
Harjo Kompagnie
Direct ICT / Servoy Hosting / ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
User avatar
Harjo
 
Posts: 4265
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby Gordon McLean » Wed Aug 20, 2014 10:46 am

Hi Harjo

I have not filed a bug, I elected for a work around as I rarely use Servoy to print, generally electing to use Velocity. This was an in house solution that I may roll out as a saas product, hence the question. I next to never use the smart client it was coincidental that I chose to save to PDF and lost the fonts and when I tried smart client got the same result hence investigating further.

best
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 191
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: Java 7, Print to PDF not recognising fonts Mac OS X

Postby Harjo » Wed Aug 20, 2014 10:54 am

it becomes even stranger!

I showed in my answer a piece of a screenshot, of 2 different preview's, right?
when I print both preview's to the same printer, the printout is exactly the same, with the right font!!! :shock:
Harjo Kompagnie
Direct ICT / Servoy Hosting / ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
User avatar
Harjo
 
Posts: 4265
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Next

Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 5 guests