print error with pdf plugin after upgrade from 6.0 to 6.1.1

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

print error with pdf plugin after upgrade from 6.0 to 6.1.1

Postby maarten » Wed Aug 29, 2012 11:28 am

After upgrading from 6.0 to 6.1.1 i'm getting an error with pdf output plugin
Error is triggered by line "controller.print(true,true,plugins.pdf_output.endMetaPrintJob())"

Any pointers?

CODE
Code: Select all
function printInvoice(event)
{
   
   var success = plugins.pdf_output.startMetaPrintJob()
   if (success)
   {
      if(product_code == "RB")
      {
         forms.invoiceSubscriptionLetter.controller.print(true,false,plugins.pdf_output.getPDFPrinter());
      }
      //point to the print form
      forms.invoiceDtl.controller.print(true,false, plugins.pdf_output.getPDFPrinter());
   }
   controller.print(true,true,plugins.pdf_output.endMetaPrintJob())
}



ERROR
Code: Select all
Can't find method com.servoy.j2db.FormController$JSForm.js_print(boolean,boolean,[B).
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Re: print error with pdf plugin after upgrade from 6.0 to 6.

Postby Andrei Costache » Thu Aug 30, 2012 9:01 am

Hi Maarten,

This is because the last argument sent to controller.print(...) should be a PrinterJob, not a byte array as returned by endMetaPrintJob().

The above code is equivalent now to something like:
Code: Select all
plugins.pdf_output.endMetaPrintJob();
forms.invoiceDtl.controller.print(true,false);


In 6.0, that line of code you mentioned, which errors out now, would have done the same operations, as above.
The error is due to stronger parameter typing in 6.1. So, in 6.0, print still required PrinterJob as the third argument, only it did not throw an error and would have done the same two operations (ending print job and printing).

Hope this helps,
Andrei
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: print error with pdf plugin after upgrade from 6.0 to 6.

Postby maarten » Thu Aug 30, 2012 11:27 am

Thanks for clarifying Andrei. Solved.
I indeed also just noticed the arguments clash warning in the script editor.
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Re: print error with pdf plugin after upgrade from 6.0 to 6.

Postby djlapin » Sat Sep 01, 2012 1:33 am

Hello,

I'm missing something more basic about endMetaPrintJob() -- after the job is done, how does one push it out to the web client? This is 6.0.x.

Thanks,
Don
djlapin
 
Posts: 309
Joined: Fri Feb 18, 2011 9:36 am
Location: San Francisco, CA

Re: print error with pdf plugin after upgrade from 6.0 to 6.

Postby Andrei Costache » Thu Sep 06, 2012 10:46 am

djlapin wrote:Hello,

I'm missing something more basic about endMetaPrintJob() -- after the job is done, how does one push it out to the web client? This is 6.0.x.

Thanks,
Don

Hi Don,

I think your related topic with the answer is here viewtopic.php?f=22&t=18715&p=100864#p100864.

Regards,
Andrei
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: print error with pdf plugin after upgrade from 6.0 to 6.

Postby gdurniak » Wed Jun 05, 2013 4:58 pm

I just got the same error, upgrading to 6.1. Our "printerJob" parameter was set to Blank ( e.g. ' ' )

Just for info, what the heck is a "printerJob" anyway ? I can't find it defined anywhere

thanks !

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: print error with pdf plugin after upgrade from 6.0 to 6.

Postby Andrei Costache » Thu Jun 06, 2013 9:20 am

Greg, the "PrinterJob" is an object that can be passed/used between the pdf_output plugin and the print command; it's used to control printing in memory or to a file.

Regards,
Andrei
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am

Re: print error with pdf plugin after upgrade from 6.0 to 6.

Postby gdurniak » Thu Jun 06, 2013 12:03 pm

In Servoy 4, I have the Developer's Reference in PDF format, where I can find a function, and see examples of it's use, with parameters

Is there any PDF Documentation for Servoy 6.1, or 7 ? This would be a big help

Note: I tried using "Help" ( F1 ) in Developer, but could not find the Print( Boolean, Boolean, PrinterJob ) Function. Odd

greg

> the "PrinterJob" is an object that can be passed/used between the pdf_output plugin and the print command
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA

Re: print error with pdf plugin after upgrade from 6.0 to 6.

Postby Andrei Costache » Thu Jun 06, 2013 12:21 pm

The current documentation (and also earlier docs) are on the Servoy wiki.
Have a look here for controller.print.

Regards,
Andrei
Andrei Costache
Servoy
User avatar
Andrei Costache
 
Posts: 196
Joined: Mon Sep 07, 2009 11:53 am


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 5 guests