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

Can Be Used Without Composer? #1

Open
moosetunes opened this issue Sep 14, 2019 · 2 comments
Open

Can Be Used Without Composer? #1

moosetunes opened this issue Sep 14, 2019 · 2 comments

Comments

@moosetunes
Copy link

moosetunes commented Sep 14, 2019

Hello. Thank you for your release. I can't run composer on my shared server so I was wondering if I can simply require/include the library php file in my script and use this utility the same way.

Please advise and thank you in advance.

Steven

P.S. I'm using PHP 5.4x

@DivineOmega
Copy link
Contributor

Hi Steven.

You should be able to just require and use the two classes that are part of this package if you need to run it without composer. Alternatively, you could run composer locally and upload the vendor directory it creates to your shared server.

@moosetunes
Copy link
Author

Thank you for your response. Couple of things. Now using as such:

use LangleyFoxall\PdfStitcher\InvalidArgumentException;
use LangleyFoxall\PdfStitcher\RuntimeException;

require 'PDFStitcher.php';

  1. Possible typo in usage instruction. See below.

(new PdfStitcher)
->addPdf('firstDocument.pdf')
->addPdfs(['secondDocument.pdf', 'yetAnotherDocument.pdf') *compiler didn't like open bracket
->save('destinationDocument.pdf');

  1. Error was generated when running:
    [16-Sep-2019 12:07:43 America/Chicago] PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /path/to/file/PDFStitcher.php on line 23

Finally - does "save('destinationDocument.pdf')" save a file to the server or does it save as a decoded PDF string with this name? If the former, can we save to a variable so that nothing has to be written to the server?

Thank you.
Steven

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