-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConvert.php
58 lines (38 loc) · 1.1 KB
/
Convert.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Converting document microsoft word journal to various template university in indonesia
* using COM (Component Object Model) extension in php for connecting word file with php, for
* reference this project :
* @link https://docs.microsoft.com/en-us/office/vba/api/overview/ VBA Reference
* @link https://www.php.net/manual/en/class.com.php COM php extension
* @link https://bettersolutions.com/word/styles/vba-code.htm another vba code
*
* @author arif iskandar <[email protected]>
*
*/
/**
* Default Configuration
*/
$config['font-name']="Times New Roman";
$word=new COM('word.application');
/**
* For development turn on
*/
$word->Visible=1;
/**
* Open document sample
*/
$word->Documents->Open(getcwd()."/sample.doc");
/**
* Set default font name for writing
*/
$word->Selection->Font->Name=$config['font-name'];
/**
* Get Title for required standar journal
*/
$title=$word->ActiveDocument->Styles("Title");
$title->Font->Size="16";
$title->Font->Bold=True;
$title->Font->Name=$config['font-name'];
$title->Borders->Enable=False;
$title->ParagraphFormat->Alignment=1;