Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to skip print preview dialog in android and ios both using this plugin #282

Open
SimranRanu opened this issue Nov 15, 2021 · 6 comments

Comments

@SimranRanu
Copy link

No description provided.

@avbapat
Copy link

avbapat commented Nov 16, 2021

Yes, you can use the below code

cordova.plugins.
printer.print('

Hello World

,
{ printerId: '' }
);

@SimranRanu
Copy link
Author

Yes, you can use the below code

cordova.plugins. printer.print('

Hello World

,
{ printerId: '' }
);

Thank you for responding...could you please clarify what will go under printerid? will it be blank?

@SimranRanu
Copy link
Author

Yes, you can use the below code

cordova.plugins. printer.print('

Hello World

,
{ printerId: '' }
);

This might work with IOS, on android it is not working

@avbapat
Copy link

avbapat commented Nov 16, 2021

Hope you are calling the plugin inside the deviceReady block ?

 document.addEventListener('deviceready', function () { 
    cordova.plugins.
printer.print('<p>Hello World</p>',
{ printerId: '' }
);
 });

Printer ID value can be the IP address of the printer that you are connected with

@SimranRanu
Copy link
Author

Hope you are calling the plugin inside the deviceReady block ?

 document.addEventListener('deviceready', function () { 
    cordova.plugins.
printer.print('<p>Hello World</p>',
{ printerId: '' }
);
 });

Printer ID value can be the IP address of the printer that you are connected with

i am getting this error "Object literal may only specify known properties, but 'printerId' does not exist in type 'PrintOptions'. Did you mean to write 'printer'?"..it is allowing me to use name 'printer' instead of 'printerid'

@ahmetsametoglu
Copy link

Yes, it must be 'printer'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants