Sign in Join
Wiki copytemporary

fpvectorial - Text Document Support: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11# fpvectorial - Text Document Support
22
33## About
44
55The [[fpvectorial]] library can be used to create formatted text files in a variety of file formats. Current file support includes Open Document XML (odt) and Open Office XML (docx). The files can be opened in a variety of products including Microsoft Office, OpenOffice and LibreOffice.
66
77As the name suggests, the FPVectorial library was originally created solely as a vector based image library. Support for creating documents was added to FPVectorial as the existing architecture already had the concept of a Document containing Pages, and it's architecture was easily extendable. Document support was added beside the existing image handling classes. Vector based images are differentiated from office documents by the type of page added to TvVectorialDocument.\
88
99At this time, two different pages can be added to TvVectorialDocument:
1010
1111- *TvTextPageSequence*: This is used by all Office Document writers.
1212- *TvVectorialPage*: This is used for Vector Image writers, and is currently ignored by the office document writers.
1313
1414Currently there are two Office Document writers.
1515
1616- *TODTVectorialWriter.pas*: for producing .odt files suitable for opening in OpenOffice and LibreOffice
1717- *TDOCXVectorialWriter*: for opening files in Microsoft Office 2007 onwards.
1818
1919Instead of focusing on the requirements of each individual file format, Office Document support inside FPVectorial was added by creating and implementing a Document Class Hierarchy. It is then up to each individual reader and writer to interpret this class hierarchy.\
2020
2121**Alternative Library - fpOdf**\
2222If you want to produce an ODT file by concentrating on the File Format, then the fpOdf library implemented by **dgaspary** and made available on the forums is recommended. This allows fine control when creating an ODT file, including many options not provided by FPVectorial - Document Support. A deeper understanding of the file format specification is required when using fpOdf; this complexity is hidden when using FPVectorial.\
2323**Forum Link:** [Topic: fpOdf - Creating and modifying OpenDocument ODF files with freepascal](http://forum.lazarus.freepascal.org/index.php/topic,21868.msg128463.html#msg128463)\
2424
2525### License
2626
2727[Modified](http://svn.freepascal.org/svn/lazarus/trunk/COPYING.modifiedLGPL.txt) [LGPL](http://svn.freepascal.org/svn/lazarus/trunk/COPYING.LGPL.txt) (same as FPC RTL and Lazarus LCL).\
2828
2929## Download
3030
3131fpvectorial comes in the Lazarus SVN, in the directory components/fpvectorial:
3232
3333`svn co `[`http://svn.freepascal.org/svn/lazarus/trunk/components/fpvectorial`](http://svn.freepascal.org/svn/lazarus/trunk/components/fpvectorial)` fpvectorial`
3434
3535See also [[fpvectorial]]\
3636
3737## Hello World Example
3838
3939The following code will produce a "Hello World" document. As no styles are defined, it is entirely up to the program used to open the resulting files (Microsoft Word, LibreOffice Write etc) to determine font and font size...
4040
4141``` pascal
4242Program HelloWorld;
4343
4444{$mode objfpc}{$H+}
4545
4646Uses
4747 fpvectorialpkg, fpvectorial;
4848
4949Var
5050 Document: TvVectorialDocument;
5151 Page: TvTextPageSequence;
5252 Paragraph: TvParagraph;
5353
5454Begin
5555 Document := TvVectorialDocument.Create;
5656 Try
5757 Page := Document.AddTextPageSequence;
5858 Paragraph := Page.AddParagraph;
5959 Paragraph.AddText('Hello World!');
6060
6161 Document.WriteToFile('Hello_World.docx', vfDOCX);
6262 Document.WriteToFile('Hello_World.odt', vfODT);
6363 Finally
6464 Document.Free;
6565 End;
6666End.
6767```
6868
6969== Basic Concepts ==
7070
7171### General
7272
7373- A single FPVectorial Document (TvVectorialDocument) consists of a series of Page Sequences.
7474- Each Page Sequence can have it's own Header and Footer, and it's own Page Setup (size, orientation)
7575- Text, Tables, Images are added to the Page Sequence. In this way the document is built up.
7676- FPVectorial has no concept of how many pages are in a document, only the number of Page Sequences. A large multipage document may only have a single Page Sequence.
7777- A single Page Sequence can have multiple Paragraphs added.
7878- Headers and Footers are built up in an identical manner to a Page Sequence.
7979- TvVectorialDocument is responsible for freeing any entity added using the .AddXXX calls.
8080
8181### Formatted Text
8282
8383- Text is added inside Paragraphs (TvParagraph).
8484- Paragraphs consist of multiple text runs or document fields. A single Paragraph can have a single Paragraph Style. Each text run can have an optional Text Style applied (allowing, for instance, the bolding of individual words in a paragraph).
8585- All Paragraph and Text Styles must be defined before being used.
8686- FP Vectorial supports style inheritance.
8787- Microsoft Office, OpenOffice and LibreOffice allow only partial styles to be defined, though each office implements its own different set of defaults for any missing properties. If it is critical that the document look identical in each of the Office Suites, then the Styles should be fully defined.
8888- A default set of Styles can be added to the FP Vectorial Document by calling AddStandardTextDocumentStyles.
8989- Headings are Paragraph Styles, with additional properties covering Heading Level and numbering
9090
9191### Document Fields
9292
9393- Document Fields are added as TvField to Paragraphs via .AddField(AKind : TvFieldKind) : TvField
9494- Currently 5 simple fields are supported: vfkNumPages, vfkPage, vfkAuthor, vfkDateCreated, vfkDate
9595- fpvectorial holds no concept of current page or page count (only Page Sequences, which are separated by Section Breaks). Best guess values will therefore be added to the document during creation. The values can be updated in Microsoft Word by Selecting All, then pressing F9 (update fields). LibreWriter appears to automatically update the fields to correct values when opening the document.
9696- Numeric Fields can be formatted via TvField.NumberFormat as Decimal, lowercase/uppercase Roman or lowercase/uppercase Alphabetic
9797- Date Fields can be formatted cia TvField.DataFormat. Default value is 'd/MM/yyyy h:mm am/pm'
9898
9999### Tables
100100
101101- Tables are centered around TvTable
102102- A TvTable consists of a collection of rows.
103103- Table rows consist of a collection of cells.
104104- Tables can add optional column information. This must be provided if merged cells are being used.
105105- Any Table Cell can support any document object, including multiple paragraphs, images and even nested Tables.
106106
107107### Lists
108108
109109- Lists are centered around TvList.
110110- Each TvList can either have a TvParagraph added, or a child TvList (which is how we get deeper levels).
111111- Each TvList has both a TvStyle (which determines the default TvParagraph text appearance) and a TvListStyle (which determines the list behaviour).
112112- Each TvListStyle holds a list of TvListLevelStyle.
113113- Each TvListLevelStyle defines how each different level of the list behaves.
114114- Each List can be bulleted, or numbered.
115115- Supported numbering: Decimal, lowercase Roman, uppercase Roman, lowercase Alphabet, uppercase Alphabet.
116116- When dealing with numbered lists: Lists can be prefixed with single identifier (ie 1.) or numeric identifiers for all levels to date (ie 1.1.1.1.). This is handled through a boolean TvListLevelStyle.DisplayLevels.
117117- Two list styles are predefined in AddStandardFormats. StyleBulletList and StyleNumberList. Interestingly, the design for both docx and odt file formats (and consequently for fpvectorial) allow for a mixing of different list definitions within a list. So you can create a list that uses a mixture of the predefined StyleBulletList and StyleNumberList.
118118
119119## Roadmap
120120
121121| Functionality | OpenDocument (ODT) | Office Open XML (DOCX) |
122122|----|----|----|
123123| File Version | ODT 1.2 with extensions | ECMA-376 1st Edition (2006) |
124124| Supported Style Types | Paragraph and Text-Span | Paragraph and Text |
125125| Table Support | Yes | Yes |
126126| List Support | Yes | Yes |
127127| Multiple Headers/Footers | Not yet | Yes |
128128| Tables in Header/Footer | Not yet | Not tested |
129129| Image Support | Not yet | Not yet |
130130| Images in Header/Footer | Not yet | Not yet |
131131| FPVectorial Image Support | Not yet | Not yet |
132132| Tab Stops | Not yet | Not yet |
133133| Document Fields | Yes | Yes |
134134| Meta Data | Partially Implemented | Not yet |
135135| Table of contents | Not planned | Not planned |
136136| Footnotes | Not planned | Not planned |
137137| Review/Revision | Not planned | Not planned |
138138| Bookmarks / Hyperlinks | Not planned | Not planned |
139139| Comments | Not planned | Not planned |
140140| Formulas | Not planned | Not planned |
141141
142142## Code Examples
143143
144144### Styles
145145
146146This example uses both the default styles that can be added to TvVectorialDocument via AddStandardTextDocumentStyles, and a Text-Span style added specifically to TvVectorialDocument. Text-Span styles should not be applied to Paragraphs, only to individual Text Spans within a Paragraph.
147147
148148``` pascal
149149Uses
150150 fpvectorialpkg, fpvectorial;
151151
152152Var
153153 Document: TvVectorialDocument;
154154 Page: TvTextPageSequence;
155155 Paragraph: TvParagraph;
156156 BoldTextStyle: TvStyle;
157157
158158Begin
159159 Document := TvVectorialDocument.Create;
160160 Try
161161 // Adds the defaut Paragraph Styles
162162 // StyleTextBody, StyleHeading1,
163163 // StyleHeading2 & StyleHeading3
164164 Document.AddStandardTextDocumentStyles(vfUnknown);
165165
166166 // Add our own Style
167167 BoldTextStyle := Document.AddStyle();
168168
169169 BoldTextStyle.Kind := vskTextSpan;
170170 BoldTextStyle.Name := 'Bold';
171171 BoldTextStyle.Font.Bold := True;
172172 BoldTextStyle.SetElements := BoldTextStyle.SetElements + [spbfFontBold];
173173
174174 // Create the Document
175175 Page := Document.AddTextPageSequence;
176176 Paragraph := Page.AddParagraph;
177177 Paragraph.Style := Document.StyleTextBody;
178178
179179 // Add Hello World as two text spans within the same paragraph,
180180 // and make 'World' bold
181181 Paragraph.AddText('Hello ');
182182 Paragraph.AddText('World!').Style := BoldTextStyle;
183183
184184 Document.WriteToFile('Hello_World.docx', vfDOCX);
185185 Document.WriteToFile('Hello_World.odt', vfODT);
186186 Finally
187187 Document.Free;
188188 End;
189189End.
190190```
191191
192-<img src="FPVectorial_-_Document_Support_-_Hello_World.png" title="Output of extended Hello World! program" width="200" />
192+![](/wiki-images/4/45/FPVectorial_-_Document_Support_-_Hello_World.png)
193193
194194### Simple Table
195195
196196This example adds a 5 column table to the Document. The first two rows are designated as Header Rows (rows which repeat at the top of each page). These header rows then have a grey background shading applied, and the text is bolded.
197197
198198The very first row contains examples of merging cells. Only 3 cells are added, with the last two cells spanning two columns each (set via .SpannedCols).
199199
200200``` pascal
201201program SimpleTable;
202202
203203{$mode objfpc}{$H+}
204204
205205uses
206206 fpvectorialpkg,
207207 fpvectorial,
208208 fpvutils, // For RGBToFPColor()
209209 SysUtils;
210210
211211var
212212 Document: TvVectorialDocument;
213213 Page: TvTextPageSequence;
214214 Paragraph: TvParagraph;
215215 BoldTextStyle: TvStyle;
216216 CenterStyle: TvStyle;
217217 Table: TvTable;
218218 Row: TvTableRow;
219219 Cell: TvTableCell;
220220 iRow: Integer;
221221 iCol: Integer;
222222
223223const
224224 // Most dimensions in FPVectorial are in mm. If you want to specify
225225 // anything in other units, be ready to do the conversion...
226226 ONE_POINT_IN_MM = 0.35278;
227227
228228begin
229229 Document := TvVectorialDocument.Create;
230230 try
231231 // Adds the defaut Paragraph Styles
232232 // StyleTextBody, StyleHeading1,
233233 // StyleHeading2 & StyleHeading3
234234 Document.AddStandardTextDocumentStyles(vfUnknown);
235235
236236 // Add our own Style for bolded text elements
237237 BoldTextStyle := Document.AddStyle();
238238 BoldTextStyle.Kind := vskTextSpan; // This style will only be applied to selected Text Spans
239239 BoldTextStyle.Name := 'Bold';
240240 BoldTextStyle.Font.Bold := True;
241241 BoldTextStyle.SetElements := BoldTextStyle.SetElements + [spbfFontBold];
242242
243243 // Add our own style for centered paragraphs
244244 CenterStyle := Document.AddStyle();
245245 CenterStyle.Kind := vskTextBody; // This style will be applied to the whole Paragraph
246246 CenterStyle.Name := 'Table Body Centered';
247247 CenterStyle.Font.Name := 'Verdana';
248248 CenterStyle.Font.Size := 8;
249249 CenterStyle.Alignment := vsaCenter;
250250 CenterStyle.MarginTop := 2 * ONE_POINT_IN_MM;
251251 CenterStyle.MarginBottom := 2 * ONE_POINT_IN_MM;
252252 CenterStyle.SetElements :=
253253 [spbfFontSize, spbfFontName, spbfAlignment, sseMarginTop, sseMarginBottom];
254254
255255 // Create the Document, and add a simple Heading
256256 Page := Document.AddTextPageSequence;
257257 Paragraph := Page.AddParagraph;
258258 Paragraph.Style := Document.StyleHeading1;
259259 Paragraph.AddText('Simple Table');
260260
261261 // Add our Table, which will have 5 columns
262262 Table := Page.AddTable;
263263 Table.PreferredWidth := Dimension(100, dimPercent);
264264
265265 // As we will be merging cells, we have to define all the column widths
266266 // so that ODT knows how many columns there will be.
267267 // Getting the width exactly correct is not essential as LibreOffice Writer
268268 // and Microsoft Word each treat this as a PreferredWidth value.
269269 Table.ColWidthsUnits:=dimMillimeter;
270270 Table.AddColWidth(50);
271271 Table.AddColWidth(50);
272272 Table.AddColWidth(50);
273273 Table.AddColWidth(50);
274274 Table.AddColWidth(50);
275275
276276 // Add a single row at the start which will contain merged cells
277277 Row := Table.AddRow;
278278 Row.BackgroundColor := RGBToFPColor(192, 192, 192); // Grey Shading
279279 Row.Header := True; // Tell the table this is a Header Row
280280 // Header Rows repeat at the top of each page
281281
282282 Cell := Row.AddCell;
283283 Paragraph := Cell.AddParagraph;
284284 Paragraph.Style := CenterStyle;
285285 Paragraph.AddText('Category 1').Style := BoldTextStyle;
286286
287287 Cell := Row.AddCell;
288288 Cell.SpannedCols:=2; // Make this cell cover two columns
289289 Paragraph := Cell.AddParagraph;
290290 Paragraph.Style := CenterStyle;
291291 Paragraph.AddText('Category 2').Style := BoldTextStyle;
292292
293293 Cell := Row.AddCell;
294294 Cell.SpannedCols:=2; // Make this cell cover two columns
295295 Paragraph := Cell.AddParagraph;
296296 Paragraph.Style := CenterStyle;
297297 Paragraph.AddText('Category 3').Style := BoldTextStyle;
298298
299299 // Add 21 rows to the Table, with the first being the header row
300300 for iRow := 0 to 20 do
301301 begin
302302 Row := Table.AddRow;
303303
304304 // Header Row
305305 if iRow = 0 then
306306 begin
307307 Row.BackgroundColor := RGBToFPColor(192, 192, 192); // Grey Shading
308308 Row.Header := True; // Tell the table this is a Header Row
309309 // Header Rows repeat at the top of each page
310310 end;
311311
312312 // Add 5 cells to each Row
313313 for iCol := 0 to 4 do
314314 begin
315315 Cell := Row.AddCell;
316316
317317 // Each Cell is a TvRichText, we cad add anything we can add to the main
318318 // body of a Document (for now Paragraphs, Tables or Lists)
319319 Paragraph := Cell.AddParagraph;
320320 Paragraph.Style := CenterStyle;
321321
322322 if iRow = 0 then
323323 Paragraph.AddText(Format('Header Col %d', [iCol])).Style := BoldTextStyle
324324 else
325325 Paragraph.AddText(Format('Cell %d x %d', [iRow, iCol]));
326326 end;
327327 end;
328328
329329 Document.WriteToFile('Simple_Table.docx', vfDOCX);
330330 Document.WriteToFile('Simple_Table.odt', vfODT);
331331 finally
332332 Document.Free;
333333 end;
334334end.
335335```
336336
337-<img src="FPVectorial_-_Document_Support_-_Simple_Table.png" title="Output of Simple Table program" width="200" />
337+![](/wiki-images/f/fe/FPVectorial_-_Document_Support_-_Simple_Table.png)
338338
339339### Lists
340340
341341Sample code to create a List Style
342342
343343``` pascal
344344Var
345345 lCurListStyle : TvListStyle;
346346 lCurListLevelStyle : TvListLevelStyle;
347347
348348Begin
349349 lCurListStyle := {TvVectorialDocument.}AddListStyle();
350350 lCurListStyle.Name := 'Numbered List Style';
351351 StyleNumberList := lCurListStyle;
352352
353353 for i := 0 To NUM_MAX_LISTSTYLES-1 Do
354354 begin
355355 lCurListLevelStyle := StyleNumberList.AddListLevelStyle;
356356 lCurListLevelStyle.Kind := vlskNumeric; // Other option in vlskBullet
357357 lCurListLevelStyle.NumberFormat:= vnfDecimal; // Other options include: vnfDecimal, vnfLowerLetter,
358358 // vnfLowerRoman, vnfUpperLetter & vnfUpperRoman
359359
360360 lCurListLevelStyle.Level := i;
361361
362362 lCurListLevelStyle.Prefix := '';
363363 lCurListLevelStyle.Suffix := '.';
364364 lCurListLevelStyle.DisplayLevels := True; // 1.1.1.1.
365365 //lCurListLevelStyle.DisplayLevels := False; // 1.
366366 lCurListLevelStyle.LeaderFontName := 'Arial';
367367
368368 // Bullet is positioned at MarginLeft - HangingIndent
369369 lCurListLevelStyle.MarginLeft := 16.35*(i + 1);
370370 lCurListLevelStyle.HangingIndent := 6.35 + 3*i;
371371 end;
372372end;
373373```
374374
375375Sample code to create a List which includes entries at different levels of indentation.
376376
377377``` pascal
378378Var
379379 List : TvList;
380380 SubList: TvList;
381381
382382Begin
383383 //...
384384 // Missing code can be copied from above examples, this is a code snippet to demonstrate lists only
385385 //...
386386
387387 // Add a simple heading
388388 CurParagraph := Page.AddParagraph();
389389 CurParagraph.Style := Vec.StyleHeading2;
390390 CurText := CurParagraph.AddText('Testing Lists');
391391
392392 // Indented numbered List
393393 List := Page.AddList();
394394 List.Style := Vec.StyleTextBody;
395395 List.ListStyle := Vec.StyleNumberList;
396396
397397 // Start the list
398398 List.AddParagraph('Level 1, Item 1');
399399 List.AddParagraph('Level 1, Item 2');
400400 List.AddParagraph('Level 1, Item 3');
401401
402402 // The next three entries are are placed at Level 2
403403 SubList := List.AddList;
404404 SubList.AddParagraph('Level 2, Item 1');
405405 SubList.AddParagraph('Level 2, Item 2');
406406 SubList.AddParagraph('Level 2, Item 3');
407407
408408 // The next three entries are are placed at Level 3
409409 With SubList.AddList Do
410410 begin
411411 AddParagraph('Level 3, Item 1');
412412 AddParagraph('Level 3, Item 2');
413413 AddParagraph('Level 3, Item 3');
414414 end;
415415
416416 // The next three entries are placed at Level 2
417417 // NOTE: We are creating this SubList from the original List
418418 SubList := List.AddList;
419419 SubList.AddParagraph('Level 2, Item 1 (new SubList added to same upper List)');
420420 SubList.AddParagraph('Level 2, Item 2 (new SubList added to same upper List)');
421421 SubList.AddParagraph('Level 2, Item 3 (new SubList added to same upper List)');
422422
423423 // The next three entries are are placed at Level 3
424424 SubList := SubList.AddList;
425425 SubList.AddParagraph('Level 3, Item 1');
426426 SubList.AddParagraph('Level 3, Item 2');
427427 SubList.AddParagraph('Level 3, Item 3');
428428
429429 // Three more entries in the original list
430430 List.AddParagraph('Level 1, Item 1 (Continuing on from same upper list)');
431431 List.AddParagraph('Level 1, Item 2 (Continuing on from same upper list)');
432432 List.AddParagraph('Level 1, Item 3 (Continuing on from same upper list)');
433433
434434 // Mixing the original list with a sublist that utilises a different ListStyle
435435 // In this case, bullets
436436 SubList := List.AddList;
437437 SubList.ListStyle := Vec.StyleBulletList;
438438 SubList.AddParagraph('Bullet Level 2, Item 1 (new SubList added to same upper List)');
439439 SubList.AddParagraph('Bullet Level 2, Item 2 (new SubList added to same upper List)');
440440 SubList.AddParagraph('Bullet Level 2, Item 3 (new SubList added to same upper List)');
441441```
442442
443443Conceptual Output from the above code:
444444
445445
4464461\. Level 1, Item 1
447447
4484482\. Level 1, Item 2
449449
4504503\. Level 1, Item 3
451451
452452
4534533.1. Level 2, Item 1
454454
4554553.2. Level 2, Item 2
456456
4574573.3. Level 2, Item 3
458458
459459
4604603.3.1. Level 3, Item 1
461461
4624623.3.2. Level 3, Item 2
463463
4644643.3.3. Level 3, Item 3
465465
4664663.4. Level 2, Item 1 (new SubList added to same upper List)
467467
4684683.5. Level 2, Item 2 (new SubList added to same upper List)
469469
4704703.6. Level 2, Item 3 (new SubList added to same upper List)
471471
472472
4734733.6.1. Level 3, Item 1
474474
4754753.6.2. Level 3, Item 2
476476
4774773.6.3. Level 3, Item 3
478478
4794794\. Level 1, Item 1 (Continuing on from same upper list)
480480
4814815\. Level 1, Item 2 (Continuing on from same upper list)
482482
4834836\. Level 1, Item 3 (Continuing on from same upper list)
484484
485485
486486• Bullet Level 2, Item 1 (new SubList added to same upper List)
487487
488488• Bullet Level 2, Item 2 (new SubList added to same upper List)
489489
490490• Bullet Level 2, Item 3 (new SubList added to same upper List)
491491
492492### Document Fields
493493
494494The following code snippet shows how Document Fields are added:
495495
496496``` pascal
497497 CurParagraph := Page.AddParagraph();
498498 CurParagraph.Style := Vec.StyleTextBody;
499499 CurParagraph.AddText('Page Count: ');
500500 CurParagraph.AddField(vfkNumPages);
501501
502502 CurParagraph := Page.AddParagraph();
503503 CurParagraph.Style := Vec.StyleTextBody;
504504 CurParagraph.AddText('Page: ');
505505 CurParagraph.AddField(vfkPage);
506506
507507 CurParagraph := Page.AddParagraph();
508508 CurParagraph.Style := Vec.StyleTextBody;
509509 CurParagraph.AddText('Author: ');
510510 CurParagraph.AddField(vfkAuthor);
511511
512512 CurParagraph := Page.AddParagraph();
513513 CurParagraph.Style := Vec.StyleTextBody;
514514 CurParagraph.AddText('Date Created: ');
515515 CurParagraph.AddField(vfkDateCreated);
516516
517517 CurParagraph := Page.AddParagraph();
518518 CurParagraph.Style := Vec.StyleTextBody;
519519 CurParagraph.AddText('Date: ');
520520 CurParagraph.AddField(vfkDate);
521521```
522522
523523Output from above:
524524
525525
526526Page Count: 3
527527
528528Page: 2
529529
530530Author: FPVECTORIAL
531531
532532Date Created: 24/09/2013
533533
534534Date: 24/09/2013 2:08 PM
535535
536536## Known Issues
537537
538538- Table support in ODT writer results in large file sizes. This is due to the fact that a style is created for each individual cell, even if multiple cells are identically formatted. This also applied to row styles and column styles. In order to resolve this, Cell, Row and Column Styles could be normalised. Alternatively, the entire table formatting architecture could be re-written to force the end user to create and apply the styles themselves (in addition to also requiring DOCX table support to be re-written to support the new architecture, specific code will need adding to DOCX writer to interpret the new FP Vectorial Table Styles).
539539- ODT Writer produces files that cannot be opened in Word 2010.
540540- File MIMETYPE in ODTDocument should not be compressed. Currently clNone compression type is ignored by TZipper (possible cause for Word 2010 rejecting existing ODT files). Patch exists, but not yet added to FPC Trunk (See <http://mantis.freepascal.org/view.php?id=24897> & <http://mantis.freepascal.org/view.php?id=23533>).
541541- Double line not supported in ODT Tables. Two locations in ODTVectorialWriter.pas need to changed to enable support:
542542 - LU_BORDERTYPE needs double adding (in CONST at start of unit. currently double is mapped to solid)
543543 - function TvODTVectorialWriter.BordersToString needs to support double (see comment at start of function)
544544
545545## TODO
546546
547547### General
548548
549549- Comprehensive testing, including opening the files in as many word processors and office suites as possible.
550550- DOCX and ODT Readers (volunteers required)
551551- Add PDF reader/writer (current PDF support is for Vector Image support only)
552552- Add HTML reader/writer
553553- Add RTF reader/writer
554554- Produce well documented examples and store in FPVectorial/Examples
555555- Code Documentation for distributing with Lazarus
556556
557557### New Code
558558
559559See Roadmap above...
560560
561561### ODTWriter
562562
563563- Support for Header/Footers and support for Tables within Headers/Footers. This requires a refactoring of ODT writer. Header and Footer content is actually stored in styles.xml, not in content.xml. All current text and table support can only produce content in content.xml.
564564
565565---
566566*From the Free Pascal wiki, page "fpvectorial - Text Document Support", as it stood on 2023-05-22 after a change by Serbod, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
567567Category: Data import and export
568568Category: FPVectorial

Back to history