#1 2016-07-12 19:17:14

Andreas
Member
Registered: 2016-07-12
Posts: 8

Print Documents (AirPrint and Android Printing Framework)

Hello,

Here is an tutorial how to print over iOS AirPrint and Android Printing Framework using a Cordova Plugin.

Open your App Options and write in the Custom plugins Textfield under the Cordova Tab following Line:

de.appplant.cordova.plugin.printer

Next Click on the OK Button and Save your work.

After that create a new JScript function in the (Functions Manager) call them print or another clear name.

if you have done this write the following in the empty function:

// This is for the Checking if it's running on Cordova
if(App.Cordova) {
  alert('This function only works in Android and iOS.');
  return;
}

// This is the Text what we have on the Printed Document
var printInformation = '<h1>Hy this is an Test-Print from Device!</h1>';

cordova.plugins.printer.print(printInformation, 'Document.html',

// This function would be fired if the user Printed or Canceled the Process.
function () {
    alert('printing finished or canceled')
});

Close the "Function window" create an push element under (Buttons) in your designer Change the Text to "Print Me" or another clear name.

Double Click on your Created Push Button and search from your actions your created function click on them.

Save your work and compile your App!

You can Print a Text over AirPrint (iOS) and Android Printing Framework.

Hopeful this was clear to understand and would help some of you.

CloudPrintExample.zip

Last edited by Andreas (2016-07-12 22:02:44)

Offline

#2 2016-07-12 20:27:50

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Print Documents (AirPrint and Android Printing Framework)

Hello Andreas,

Welcome to the forum and thanks very much for sharing this! smile

Offline

#3 2016-07-12 22:02:32

Andreas
Member
Registered: 2016-07-12
Posts: 8

Re: Print Documents (AirPrint and Android Printing Framework)

Thank you David,
You're Welcome smile

Offline

#4 2016-07-14 04:27:11

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: Print Documents (AirPrint and Android Printing Framework)

will try,thanks,Andreas


Joshua.Y

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.