Ciao
Stavo cercando di ottenere grabzit per accelerare il processo di acquisizione e ho scoperto che "save"Il metodo / asincrono dovrebbe essere più veloce dopo aver fatto qualche lettura sul tuo sito. Il problema è quando provo ad usarlo, non sembra funzionare. Quando uso il"saveTo", che funziona bene. Quindi non sono sicuro di cosa mi manchi? Ho aggiunto l'esempio di entrambi i metodi di seguito e mi chiedevo se hai visto qualcosa che potrebbe essere sbagliato. Sto usando ajax per passare le informazioni allo script php.
"saveTo"esempio sotto .... (funzionante)
session_start ();
includere ( "php / lib / GrabzItClient.php");
$grabzIt = new \GrabzIt\GrabzItClient("OGEzYWE1Mjg2NDQwNGM5ODlhZTYxNDVlMjJiMjIzMTk=", "P1odIFI/Oj80Hj8/PxFcPz8/C1A/CAkqP08EPz9TPz8=");
$ pages = $ _POST ['pagine'];
$ coverW = $ _POST ['coverW'];
$ coverH = $ _POST ['coverH'];
$ index = $ _POST ['index'];
$ coverW2 = round ($ coverW * 0.1);
$ coverH2 = round ($ coverH * 0.1);
$ getsize = $ _POST ['getsize'];
$ getemail = $ _SESSION ['Capture1'];
$ gettitle = $ _POST ['gettitle'];
$ getdatecreated = $ _POST ['getdatecreated'];
$ gettimecreated = $ _POST ['gettimecreated'];
$ getbooktheme = $ _POST ['getbooktheme'];
$ newTheme = $ _POST ['newTheme'];
$ options = new \ GrabzIt \ GrabzItImageOptions();
$ opzioni-> setCountry ("US");
$ opzioni-> setBrowserWidth ($ coverW);
$ opzioni-> setBrowserHeight ($ coverH);
$ opzioni-> setWidth ($ coverW);
$ opzioni-> setHeight ($ coverH);
$ opzioni-> setFormat ("jpg");
$ opzioni-> setTargetElement (". viewcover");
$ grabzIt->HTMLToImage($ pagine, $ opzioni);
$ grabzIt->SaveTo("tempUpload / spread". $ index. ". jpg");
echo $ index;
"save"esempio sotto ... (non funzionante)
session_start ();
includere ( "php / lib / GrabzItClient.php");
$grabzIt = new \GrabzIt\GrabzItClient("OGEzYWE1Mjg2NDQwNGM5ODlhZTYxNDVlMjJiMjIzMTk=", "P1odIFI/Oj80Hj8/PxFcPz8/C1A/CAkqP08EPz9TPz8=");
$ pages = $ _POST ['pagine'];
$ coverW = $ _POST ['coverW'];
$ coverH = $ _POST ['coverH'];
$ index = $ _POST ['index'];
$ coverW2 = round ($ coverW * 0.1);
$ coverH2 = round ($ coverH * 0.1);
$ getsize = $ _POST ['getsize'];
$ getemail = $ _SESSION ['Capture1'];
$ gettitle = $ _POST ['gettitle'];
$ getdatecreated = $ _POST ['getdatecreated'];
$ gettimecreated = $ _POST ['gettimecreated'];
$ getbooktheme = $ _POST ['getbooktheme'];
$ newTheme = $ _POST ['newTheme'];
$ options = new \ GrabzIt \ GrabzItImageOptions();
$ opzioni-> setCountry ("US");
$ opzioni-> setBrowserWidth ($ coverW);
$ opzioni-> setBrowserHeight ($ coverH);
$ opzioni-> setWidth ($ coverW);
$ opzioni-> setHeight ($ coverH);
$ opzioni-> setFormat ("jpg");
$ opzioni-> setTargetElement (". viewcover");
$ grabzIt->HTMLToImage($ pagine, $ opzioni);
$ grabzIt->Save("https://www.capturehearts.com/Capturehearts/photobookapp/tempUpload/spread".$index.".jpg");
echo $ index;