I'm trying to read a Doc from Google with an authorized user and output the content through my page.
Everything works fine, and the output is Ok, but after few seconds, a popup window appears with an error "Google Docs has encountered an error. We are looking into the problem now. Please try one of these interim solutions: Reload this page"
My code is this:
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_Docs');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Gdata_Docs_Query');
$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
$client_grabmark = Zend_Gdata_ClientLogin::getHttpClient('[email protected]', 'MYPASS', $service);
$service = new Zend_Gdata_Docs($client_grabmark);
$service->setMajorProtocolVersion(3);
$contentLink = 'https://docs.google.com/document/d/'DOCID'/edit';
$data = $service->get($contentLink)->getBody();
ob_start();
echo $data;
ob_flush();
exit
?>
What I'm doing wrong? If I try export to PDF everything is Ok (I just have to change the link), but I want to show the page as if I was in Google Docs.
Any help? Best Regards DF