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

Printing On PHP #22

Open
jecorrales3 opened this issue Nov 24, 2017 · 1 comment
Open

Printing On PHP #22

jecorrales3 opened this issue Nov 24, 2017 · 1 comment

Comments

@jecorrales3
Copy link

Hi, I'm so facinated with this API, I've read all about it, I just want to print from my APP WEB and I think that this can help me, but, firstly I need to know something else:

Context Software
My system basically takes the register of a person, with his personal data.

  • ID
  • Name
  • LastName
  • HourRegister
  • DateRegister
  • Barcode (ID)
  • And the place that he goes, and with the label from my Dymo I print that data on it!

How I'm Doing The Printing For My Software
Actually my software is in production, and the printing proccess is with the preview printing from the navigator and what I need is for it to always be printed.

  • My Label is designed with HTML and that section is printed.
  • With the method window.print()

Why I'm here?

  • Because I need to know if the label was printed or not, and, with the preview printed I can press the button Cancel and only register the people without the label and the Label is my obvjective.

Label

  • 30256 Shipping

Questions

  1. Is it necessary that will be printed on PDF?
  2. If that is false, how can I create my Label?
  3. In production I have 3 PC's, so, I need to one account for everyone or ?
  4. What is wrong with this code, I've prove with some examples and it doesn't work!

CODE

` <?php
include 'PrintNode/Loader.php';

$credentials = new PrintNode\Credentials('xxxxx.xxxxxx',
'xxxxxxxxxxxxxxxxxxxx');
$credentials->setApiKey(PRINTNODE_APIKEY);
$request = new PrintNode\Request($credentials);

// Initialise a Child Account

$account = new PrintNode\Account();
// Set properties on the Child Account
$account->Account = array(
"firstname" => "11",
"lastname" => "111",
"password" => "111111",
"email" => "[email protected]"
);
// Post the Child Account to the API
$aNewAccount = $request->post($account);
// You can get the Child Account ID from the response object
$id = $aNewAccount->GetDecodedContent()["Account"]["id"];
?>`

RESULT

Fatal error: Class 'PrintNode\Entity' not found in C:\xampp\htdocs\Prueba\Code\PrintNode\Account.php on line 15

@n10000k
Copy link

n10000k commented Apr 5, 2018

You can use a php script to generate a PDF file then submit that to the API with your selected printer and it will print.

For multiple printers, I would suggest you setup a main server and network share all your printers so you can just install PrintNode client on the main machine and access all the available printers without a problem.

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

2 participants