%PDF- %PDF-
Direktori : /home/tojsat/public_html/ydx/book/ |
Current File : /home/tojsat/public_html/ydx/book/test.php |
<?php /* 19 istec europe 18 inte 22 idec 21 iticam */ @ob_start(); @session_start(); error_reporting(1); include_once "db.php"; $vt=new db(); include_once 'fonksiyonlar.php'; // istec, inte, idec, iticam //\PhpOffice\PhpWord\Shared\Converter::cmToTwip(2) require_once __DIR__ . '\bootstrap.php'; use PhpOffice\PhpWord\Settings; date_default_timezone_set('UTC'); error_reporting(E_ALL); define('CLI', (PHP_SAPI == 'cli') ? true : false); define('EOL', CLI ? PHP_EOL : '<br />'); $phpWord = new \PhpOffice\PhpWord\PhpWord(); $phpWord->setDefaultFontName('Times New Roman'); $phpWord->setDefaultFontSize(10); $phpWord->setDefaultParagraphStyle(array('spaceBefore'=>0, 'spaceAfter'=>0,'lineHeight'=>1)); /* Note: any element you append to a document must reside inside of a Section. */ // Adding an empty Section to the document... $sectionStyle = array( 'orientation' => 'portrait', 'pageSizeH' => \PhpOffice\PhpWord\Shared\Converter::cmToTwip(22.9), 'pageSizeW' => \PhpOffice\PhpWord\Shared\Converter::cmToTwip(16.2), 'marginLeft' => \PhpOffice\PhpWord\Shared\Converter::cmToTwip(1), 'marginRight' => \PhpOffice\PhpWord\Shared\Converter::cmToTwip(1), 'marginTop' => \PhpOffice\PhpWord\Shared\Converter::cmToTwip(1.27), 'marginBottom' => \PhpOffice\PhpWord\Shared\Converter::cmToTwip(1.41), 'colsNum' => 1, 'pageNumberingStart' => 1, ); $section = $phpWord->addSection($sectionStyle); // Adding Text element to the Section having font styled by default... $header = $section->addHeader(); $footer = $section->addFooter(); $header->addText( 'TOJSAT EUROPE, INTE, IDEC, ITICAM 2017 <w:br/> CONFERENCE PROGRAMME', array('name' => 'Helvetica Neue', 'size' => 12, 'bold' => true ), array('align'=>'center') ); $footer->addPreserveText('{PAGE}', array('align'=>'center') ); $section->addText( 'Editör yazısı<w:br/> aaaaa', array('name' => 'Helvetica Neue', 'size' => 12) ); $section = $phpWord->addSection($sectionStyle); $vt->OrganizasyonKomitesi(19,$section); // Adding Text element to the Section having font styled by default... /* $header = $section->addHeader(); $footer = $section->addFooter(); $header->addText( 'TOJSAT 2017 EUROPE CONFERENCE PROGRAMME', array('name' => 'Helvetica Neue', 'size' => 12, 'bold' => true ), array('align'=>'center') ); //$section->addPageBreak(); $section->addText( 'İçerik', array('name' => 'Helvetica Neue', 'size' => 12) ); */ // Saving the document as OOXML file... //$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); //$objWriter->save('helloWorld.docx'); $file = '2017 Europe Booklet.docx'; header("Content-Description: File Transfer"); header('Content-Disposition: attachment; filename="' . $file . '"'); header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document'); header('Content-Transfer-Encoding: binary'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Expires: 0'); $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); $xmlWriter->save("php://output"); ?>