वेब पर कब्जा और परिवर्तित करने के लिए उपकरण
GrabzIt के ऑनलाइन समुदाय

Upgrading to v3.4.5 - errors

वेब पेजों या HTML को कैप्चर करने या परिवर्तित करने के तरीके पर प्रश्न पूछें into चित्र, CSV, PDF या DOCX दस्तावेज़ और साथ ही वीडियो कैसे परिवर्तित करें intओ एनिमेटेड GIF हमारे एपीआई का उपयोग कर रहा है।

Two issues:

(1) When installing via Composer the folder structure is very different and is missing many subfolders such as "ajax", "css", etc. Are these not needed when using Grabzit only from the server side (php)?

(2) After downloading the php client I notice the classes are named differently (previously I had "require_once 'vendor/GrabzIt/lib/GrabzItClient.कक्षा.php';" but now it's "require_once 'vendor/GrabzIt/lib/GrabzItClient.php';"). However, when I try to generate a PDF using this code:

// Create the GrabzItClient class
$grabzIt = new GrabzItClient(GRABZIT_APP_KEY, GRABZIT_APP_SECRET);
$pdfOptions = new GrabzItPDFOptions();

मुझे एक त्रुटि संदेश मिलता है:

[17-Jan-2021 11:12:26 America/Toronto] PHP Fatal error: Cannot declare class GrabzIt\GrabzItClient, because the name is already in use in /Users/Ross/Dropbox/htdocs/wonderfest_mamp_pro/private/contest/include/vendor/GrabzIt/lib/GrabzItClient.php on line 11

I really want to use v3.4.5 but this is blocking my development.

रॉस वाडेल द्वारा 17 जनवरी 2021 को पूछा गया

It sounds like you are using the legacy version of the PHP  library we moved to using namespaces etc about two and a half years ago. The 3.4.5 legacy version is available on the download page for a manual download.

The legacy version will not be made available on composer as it is only being kept for backwards compatibility. The ajax and css folders are not included as they are part of the demo application and not the library.

If you want to move to the latest version the examples in the PHP प्रलेखन should help the changes are relatively minor.

 

 

 

 

GrabzIt सपोर्ट द्वारा 17 जनवरी 2021 को उत्तर दिया गया

I installed via Composer but when I go to generate my PDF I get a new error:

 

// Create the GrabzItClient class
$grabzIt = new \GrabzIt\GrabzItClient(GRABZIT_APP_KEY, GRABZIT_APP_SECRET);
$pdfOptions = new \GrabzIt\GrabzItBaseOptions();

$pdfOptions->setPageSize("Letter");
$pdfOptions->setOrientation("Landscape");
$pdfOptions->setMarginLeft(PDF_MARGIN_LEFT);
$pdfOptions->setMarginTop(PDF_MARGIN_TOP);
$pdfOptions->setMarginRight(PDF_MARGIN_RIGHT);

त्रुटि:

[17-Jan-2021 13:10:49 America/Toronto] PHP Fatal error: Uncaught Error: Call to undefined method GrabzIt\GrabzItBaseOptions::setPageSize() in /Users/Ross/Dropbox/htdocs/wonderfest_mamp_pro/private/contest/include/createPDF.php:120

 

Answered by Ross Waddell on the 17th of January 2021

You have initialized a GrabzItBaseOptions instead of GrabzItPDFOptions

GrabzIt सपोर्ट द्वारा 17 जनवरी 2021 को उत्तर दिया गया