Giter VIP home page Giter VIP logo

Comments (6)

uomopalese avatar uomopalese commented on May 20, 2024 1

I'm getting this error:
Fatal error: Uncaught Ilovepdf\Exceptions\AuthException: Unauthorized in /Users/me/Sites/pdf-a/vendor/ilovepdf/ilovepdf-php/src/Ilovepdf.php on line 185
can you help please?
my code (from samples folder):

require_once('vendor/autoload.php');
require_once('vendor/ilovepdf/ilovepdf-php/init.php');

use Ilovepdf\PdfaTask;

$myTask = new PdfaTask('project_public_id','project_secret_key');

$file = $myTask->addFile('myfile.pdf');

$file->setConformance('pdfa-1a');

$myTask->setAllowDowngrade(false);

$myTask->setOutputFilename('pdfa');

$myTask->execute();

$myTask->download('/Users/me/Sites/download');

from ilovepdf-php.

maztch avatar maztch commented on May 20, 2024

Please make sure the require can acces the file from the script path. Maybe add a full path from current file path on require?

require_once(__DIR__ . "ilovepdf/init.php");

from ilovepdf-php.

dhirajsah avatar dhirajsah commented on May 20, 2024

Did the same still not working.

from ilovepdf-php.

beard7 avatar beard7 commented on May 20, 2024

@dhirajsah Try using the full namespace:
$ilovepdf = new Ilovepdf\Ilovepdf('project_public_id', 'project_secret_key');

You may also need a backslash in front of the first \Ilovepdf

from ilovepdf-php.

marcogrossisas avatar marcogrossisas commented on May 20, 2024

@uomopalese hello, this should be a new issue.

But, do you have registered and swap the
$myTask = new PdfaTask('project_public_id','project_secret_key');

project_public_id and project_secret_key by the keys provided in your control panel?

from ilovepdf-php.

uomopalese avatar uomopalese commented on May 20, 2024

Sorry, I thought this was a self-contained library to convert pdf to pdf/a using PHP, did not understand this was related to a website. Actually I don't have an account to ILovePDF. My fault.

from ilovepdf-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.