您好
我試圖抓拍以加快捕獲過程,發現“save“ /異步方法在您的站點上進行閱讀後應該會更快。問題是當我嘗試使用它時,它似乎不起作用。當我使用”saveTo“方法,效果很好。所以我不確定我缺少什麼嗎?我在下面添加了這兩種方法的示例,想知道您是否發現任何可能出錯的地方。我正在使用ajax傳遞信息到PHP腳本。
"saveTo“下面的示例...。(工作中)
session_start();
include(“ php / lib / GrabzItClient.php”);
$grabzIt = new \GrabzIt\GrabzItClient("OGEzYWE1Mjg2NDQwNGM5ODlhZTYxNDVlMjJiMjIzMTk=", "P1odIFI/Oj80Hj8/PxFcPz8/C1A/CAkqP08EPz9TPz8=");
$ pages = $ _POST ['pages'];
$ coverW = $ _POST ['coverW'];
$ coverH = $ _POST ['coverH'];
$ index = $ _POST ['index'];
$ coverW2 =舍入($ coverW * 0.1);
$ coverH2 =舍入($ 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();
$ options-> setCountry(“ US”);
$ options-> setBrowserWidth($ coverW);
$ options-> setBrowserHeight($ coverH);
$ options-> setWidth($ coverW);
$ options-> setHeight($ coverH);
$ options-> setFormat(“ jpg”);
$ options-> setTargetElement(“。viewcover”);
$ grabzIt->HTMLToImage($ pages,$ options);
$ grabzIt->SaveTo(“ tempUpload / spread”。$ index。“。jpg”);
echo $ index;
"save“下面的示例...(不起作用)
session_start();
include(“ php / lib / GrabzItClient.php”);
$grabzIt = new \GrabzIt\GrabzItClient("OGEzYWE1Mjg2NDQwNGM5ODlhZTYxNDVlMjJiMjIzMTk=", "P1odIFI/Oj80Hj8/PxFcPz8/C1A/CAkqP08EPz9TPz8=");
$ pages = $ _POST ['pages'];
$ coverW = $ _POST ['coverW'];
$ coverH = $ _POST ['coverH'];
$ index = $ _POST ['index'];
$ coverW2 =舍入($ coverW * 0.1);
$ coverH2 =舍入($ 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();
$ options-> setCountry(“ US”);
$ options-> setBrowserWidth($ coverW);
$ options-> setBrowserHeight($ coverH);
$ options-> setWidth($ coverW);
$ options-> setHeight($ coverH);
$ options-> setFormat(“ jpg”);
$ options-> setTargetElement(“。viewcover”);
$ grabzIt->HTMLToImage($ pages,$ options);
$ grabzIt->Save(“ https://www.capturehearts.com/Capturehearts/photobookapp/tempUpload/spread".$index.".jpg”);
echo $ index;