mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 23:58:06 +02:00
fpvectorial: Extend fpvtextwritetest2 to optionally use pdfwriter.
This commit is contained in:
parent
57381cefb7
commit
6eb18a2d11
@ -35,15 +35,11 @@
|
||||
<DefaultFilename Value="..\fpvectorialpkg.lpk" Prefer="True"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Units Count="1">
|
||||
<Unit0>
|
||||
<Filename Value="fpvtextwritetest2.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="..\odtxmlvectorialwriter.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
@ -54,7 +50,6 @@
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value=".."/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
|
@ -9,11 +9,11 @@ License: Public Domain
|
||||
Program fpvtextwritetest2;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
{.$define pdf_test}
|
||||
|
||||
Uses
|
||||
fpvectorial,
|
||||
odtvectorialwriter,
|
||||
docxvectorialwriter,
|
||||
odtvectorialwriter, docxvectorialwriter, {$ifdef pdf_test}pdfvectorialwriter,{$endif}
|
||||
fpvutils,
|
||||
SysUtils, FPImage;
|
||||
|
||||
@ -153,6 +153,7 @@ Begin
|
||||
CurParagraph.AddText('Lazarus ').Style := BoldTextStyle;
|
||||
CurParagraph.AddText('features:');
|
||||
|
||||
{$ifndef pdf_test}
|
||||
// Simple List
|
||||
List := Page.AddList();
|
||||
List.Style := ListParaStyle;
|
||||
@ -171,12 +172,12 @@ Begin
|
||||
List.AddParagraph('Text resource manager for internationalization');
|
||||
List.AddParagraph('Automatic code formatting');
|
||||
List.AddParagraph('The ability to create custom components');
|
||||
{$endif}
|
||||
|
||||
// Empty line
|
||||
CurParagraph := Page.AddParagraph();
|
||||
CurParagraph.Style := Vec.StyleTextBody;
|
||||
|
||||
|
||||
// Second page sequence
|
||||
Page := Vec.AddTextPageSequence();
|
||||
Page.Height := 210; // Switched to enforce Landscape
|
||||
@ -192,7 +193,6 @@ Begin
|
||||
CurParagraph.Style := Vec.StyleHeading2;
|
||||
CurParagraph.AddText('Testing Strings');
|
||||
|
||||
|
||||
// Test for XML tags
|
||||
CurParagraph := Page.AddParagraph();
|
||||
CurParagraph.Style := Vec.StyleTextBody;
|
||||
@ -243,6 +243,7 @@ Begin
|
||||
CurText := CurParagraph.AddText('Testing Lists');
|
||||
|
||||
// Indented numbered List
|
||||
{$ifndef pdf_test}
|
||||
List := Page.AddList();
|
||||
List.Style := ListParaStyle;
|
||||
List.ListStyle := Vec.StyleNumberList;
|
||||
@ -282,6 +283,7 @@ Begin
|
||||
SubList.AddParagraph('Bullet Level 2, Item 1 (new SubList added to same upper List)');
|
||||
SubList.AddParagraph('Bullet Level 2, Item 2 (new SubList added to same upper List)');
|
||||
SubList.AddParagraph('Bullet Level 2, Item 3 (new SubList added to same upper List)');
|
||||
{$endif}
|
||||
|
||||
// Third page sequence
|
||||
Page := Vec.AddTextPageSequence();
|
||||
@ -499,6 +501,11 @@ Begin
|
||||
Vec.WriteToFile('text_output_odt', vfODT);
|
||||
WriteLn('Native odt writer: '+Format('%.1f msec', [24*60*60*1000*(Now-dtTime)]));
|
||||
|
||||
{$ifdef pdf_test}
|
||||
dtTime := Now;
|
||||
Vec.WriteToFile('text_output_pdf', vfPDF);
|
||||
WriteLn('Native pdf writer: '+Format('%.1f msec', [24*60*60*1000*(Now-dtTime)]));
|
||||
{$endif}
|
||||
|
||||
Finally
|
||||
Vec.Free;
|
||||
|
Loading…
Reference in New Issue
Block a user