Pre Development Create project get project no:(to be set in Appscript Settings) create web client Get Client_ID(used in js, PHP and android app) and Client Secret(used in PHP ie backend app only) from Web client Add required scopes For JS ,get API key(used in javascript while intitializing gapi client (gapi.client.init). For Backend(PHP), Set Redirect URLs(…
Category: PHP Libraries
Get Google API Dependecy scripts PHP API Client gives an avenue to use Google Services. Download them with composer composer require google/apiclient:^2.15.0 Set up Front End Front end should have 2 components Login Screen Operations page Set up Backend Backend should handle following Show Login Button. Get tokens JSON with auth code. Refresh token on…
There are 3 ways to do it Each methods has its own Pros and Cons Crass way , Subclassing container class and using templateProcessor->setComplexBlock templateProcessor->setComplexBlock will give Error, Uncaught Error: Class ‘PhpOffice\PhpWord\Writer\Word2007\Element\Section’ not found. That is why container subclass is used namespace PhpOffice\PhpWord\Writer\Word2007\Element; class Section extends Container{} and then $phpWord = new \PhpOffice\PhpWord\PhpWord();//$this->templateProcessor->makeTable();//new \PhpOffice\PhpWord\PhpWord(); $section…
Finding and replacing text with PHPWord https://stackoverflow.com/a/20220205 PHPWord is only intented to create docx files. Anyhow, a docx file is simply a collection of xml files in a zip container. In general what you need to do is: Rename xxx.docx to xxx.zip Unzip to a temporary folder In temporary_folder_from_unzipped_doc/word read in document.xml which contains all…
Parser using https://www.pdfparser.org/ Installation Extracting Text
https://manuals.setasign.com/fpdi-manual/ I am using V1 since more tutorials are available in it FPDI & FPDF Installation FPDF Hello World Example FPDI Merge PDFs & Put Page numbers
$section->addListItem($text, [$depth], [$fontStyle], [$listStyle], [$paragraphStyle]);$listItemRun = $section->addListItemRun([$depth], [$listStyle], [$paragraphStyle]); Basic UsageaddListItem is used for creating lists that only contain plain text. addListItemRun is used for creating complex list items that contains texts with different style (some bold, other italics, etc) or other elements, e.g. images or links.
Simpler Method to Add a table : replacing a placeholder with Template Processor Replace an Existing Table with ZipArchive Class
Two nice references https://phpword.readthedocs.io/en/latest/templates-processing.htmlhttps://hotexamples.com/examples/-/PhpOffice%255CPhpWord%255CTemplateProcessor/-/php-phpoffice%255cphpword%255ctemplateprocessor-class-examples.html An example for using phpWord Templates can be found here: http://phpword.readthedocs.org/en/latest/templates.html
PHP Word provides \PhpOffice\PhpWord\IOFactory::createReader . its ‘load’ method returns contents as an object However , this object is too complex if the intention is to just get the text contents for search. The complete Code would look like this. So a simpler way could be adopted using PHP ‘zip_read’