Nenhuma descrição

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. .. _intro:
  2. Introduction
  3. ============
  4. PHPWord is a library written in pure PHP that provides a set of classes
  5. to write to and read from different document file formats. The current
  6. version of PHPWord supports Microsoft `Office Open
  7. XML <http://en.wikipedia.org/wiki/Office_Open_XML>`__ (OOXML or
  8. OpenXML), OASIS `Open Document Format for Office
  9. Applications <http://en.wikipedia.org/wiki/OpenDocument>`__
  10. (OpenDocument or ODF), and `Rich Text
  11. Format <http://en.wikipedia.org/wiki/Rich_Text_Format>`__ (RTF).
  12. PHPWord is an open source project licensed under the terms of `LGPL
  13. version 3 <https://github.com/PHPOffice/PHPWord/blob/develop/COPYING.LESSER>`__.
  14. PHPWord is aimed to be a high quality software product by incorporating
  15. `continuous integration <https://travis-ci.org/PHPOffice/PHPWord>`__ and
  16. `unit testing <http://phpoffice.github.io/PHPWord/coverage/develop/>`__.
  17. You can learn more about PHPWord by reading this Developers'
  18. Documentation and the `API
  19. Documentation <http://phpoffice.github.io/PHPWord/docs/develop/>`__.
  20. Features
  21. --------
  22. - Set document properties, e.g. title, subject, and creator.
  23. - Create document sections with different settings, e.g.
  24. portrait/landscape, page size, and page numbering
  25. - Create header and footer for each sections
  26. - Set default font type, font size, and paragraph style
  27. - Use UTF-8 and East Asia fonts/characters
  28. - Define custom font styles (e.g. bold, italic, color) and paragraph
  29. styles (e.g. centered, multicolumns, spacing) either as named style
  30. or inline in text
  31. - Insert paragraphs, either as a simple text or complex one (a text
  32. run) that contains other elements
  33. - Insert titles (headers) and table of contents
  34. - Insert text breaks and page breaks
  35. - Insert right-to-left text
  36. - Insert and format images, either local, remote, or as page watermarks
  37. - Insert binary OLE Objects such as Excel or Visio
  38. - Insert and format table with customized properties for each rows
  39. (e.g. repeat as header row) and cells (e.g. background color,
  40. rowspan, colspan)
  41. - Insert list items as bulleted, numbered, or multilevel
  42. - Insert hyperlinks
  43. - Insert footnotes and endnotes
  44. - Insert drawing shapes (arc, curve, line, polyline, rect, oval)
  45. - Insert charts (pie, doughnut, bar, line, area, scatter, radar)
  46. - Insert form fields (textinput, checkbox, and dropdown)
  47. - Create document from templates
  48. - Use XSL 1.0 style sheets to transform main document part of OOXML
  49. template
  50. - ... and many more features on progress
  51. File formats
  52. ------------
  53. Below are the supported features for each file formats.
  54. Writers
  55. ~~~~~~~
  56. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  57. | Features | | DOCX | ODT | RTF | HTML | PDF |
  58. +===========================+======================+========+=======+=======+========+=======+
  59. | **Document Properties** | Standard | ✓ | ✓ | ✓ | ✓ | ✓ |
  60. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  61. | | Custom | ✓ | ✓ | | | |
  62. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  63. | **Element Type** | Text | ✓ | ✓ | ✓ | ✓ | ✓ |
  64. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  65. | | Text Run | ✓ | ✓ | ✓ | ✓ | ✓ |
  66. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  67. | | Title | ✓ | ✓ | | ✓ | ✓ |
  68. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  69. | | Link | ✓ | ✓ | ✓ | ✓ | ✓ |
  70. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  71. | | Preserve Text | ✓ | | | | |
  72. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  73. | | Text Break | ✓ | ✓ | ✓ | ✓ | ✓ |
  74. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  75. | | Page Break | ✓ | | ✓ | | |
  76. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  77. | | List | ✓ | | | | |
  78. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  79. | | Table | ✓ | ✓ | ✓ | ✓ | ✓ |
  80. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  81. | | Image | ✓ | ✓ | ✓ | ✓ | |
  82. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  83. | | Object | ✓ | | | | |
  84. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  85. | | Watermark | ✓ | | | | |
  86. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  87. | | Table of Contents | ✓ | | | | |
  88. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  89. | | Header | ✓ | | | | |
  90. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  91. | | Footer | ✓ | | | | |
  92. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  93. | | Footnote | ✓ | | | ✓ | |
  94. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  95. | | Endnote | ✓ | | | ✓ | |
  96. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  97. | **Graphs** | 2D basic graphs | ✓ | | | | |
  98. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  99. | | 2D advanced graphs | | | | | |
  100. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  101. | | 3D graphs | ✓ | | | | |
  102. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  103. | **Math** | OMML support | | | | | |
  104. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  105. | | MathML support | | | | | |
  106. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  107. | **Bonus** | Encryption | | | | | |
  108. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  109. | | Protection | | | | | |
  110. +---------------------------+----------------------+--------+-------+-------+--------+-------+
  111. Readers
  112. ~~~~~~~
  113. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  114. | Features | | DOCX | DOC | ODT | RTF | HTML |
  115. +===========================+======================+========+=======+=======+=======+=======+
  116. | **Document Properties** | Standard | ✓ | | | | |
  117. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  118. | | Custom | ✓ | | | | |
  119. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  120. | **Element Type** | Text | ✓ | ✓ | ✓ | ✓ | ✓ |
  121. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  122. | | Text Run | ✓ | | | | |
  123. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  124. | | Title | ✓ | | ✓ | | |
  125. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  126. | | Link | ✓ | ✓ | | | |
  127. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  128. | | Preserve Text | ✓ | | | | |
  129. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  130. | | Text Break | ✓ | ✓ | | | |
  131. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  132. | | Page Break | ✓ | | | | |
  133. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  134. | | List | ✓ | | ✓ | | ✓ |
  135. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  136. | | Table | ✓ | | | | ✓ |
  137. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  138. | | Image | ✓ | ✓ | | | |
  139. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  140. | | Object | | | | | |
  141. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  142. | | Watermark | | | | | |
  143. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  144. | | Table of Contents | | | | | |
  145. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  146. | | Header | ✓ | | | | |
  147. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  148. | | Footer | ✓ | | | | |
  149. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  150. | | Footnote | ✓ | | | | |
  151. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  152. | | Endnote | ✓ | | | | |
  153. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  154. | **Graphs** | 2D basic graphs | | | | | |
  155. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  156. | | 2D advanced graphs | | | | | |
  157. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  158. | | 3D graphs | | | | | |
  159. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  160. | **Math** | OMML support | | | | | |
  161. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  162. | | MathML support | | | | | |
  163. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  164. | **Bonus** | Encryption | | | | | |
  165. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  166. | | Protection | | | | | |
  167. +---------------------------+----------------------+--------+-------+-------+-------+-------+
  168. Contributing
  169. ------------
  170. We welcome everyone to contribute to PHPWord. Below are some of the
  171. things that you can do to contribute.
  172. - Read `our contributing
  173. guide <https://github.com/PHPOffice/PHPWord/blob/master/CONTRIBUTING.md>`__.
  174. - `Fork us <https://github.com/PHPOffice/PHPWord/fork>`__ and `request
  175. a pull <https://github.com/PHPOffice/PHPWord/pulls>`__ to the
  176. `develop <https://github.com/PHPOffice/PHPWord/tree/develop>`__
  177. branch.
  178. - Submit `bug reports or feature
  179. requests <https://github.com/PHPOffice/PHPWord/issues>`__ to GitHub.
  180. - Follow `@PHPWord <https://twitter.com/PHPWord>`__ and
  181. `@PHPOffice <https://twitter.com/PHPOffice>`__ on Twitter.