fpvectorial: Add new pdf writer to package. Modify fpvTextWriteTest demo to support pdfwriter.

This commit is contained in:
wp_xyz 2023-08-22 18:49:35 +02:00
parent 4a653549e1
commit 24e996ddef
4 changed files with 35 additions and 21 deletions

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="fpvtextwritetest"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
@ -17,21 +17,17 @@
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1">
<Item1 Name="default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default"/>
</Modes>
</RunParams>
<RequiredPackages Count="1">
<Item1>
@ -43,7 +39,6 @@
<Unit0>
<Filename Value="fpvtextwritetest.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="fpvtextwritetest"/>
</Unit0>
</Units>
</ProjectOptions>
@ -57,12 +52,11 @@
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Other>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">

View File

@ -9,8 +9,13 @@ program fpvtextwritetest;
{$mode objfpc}{$H+}
{$define pdf_test}
uses
fpvectorial, odtvectorialwriter, docxvectorialwriter, fpvutils;
fpvectorial,
odtvectorialwriter, docxvectorialwriter,
{$ifdef pdf_test} pdfvectorialwriter, {$endif}
fpvutils;
{$R *.res}
@ -58,6 +63,7 @@ begin
CurParagraph.Style := Vec.StyleTextBody;
// Lazarus provides a highly visual development environment for the creation of rich user interfaces, application logic, and other supporting code artifacts. Along with the customary project management features, the Lazarus IDE also provides features that includes but are not limited to:
{$ifndef pdf_test}
CurList := Page.AddList();
CurList.ListStyle := Vec.StyleBulletList;
CurList.Style := Vec.StyleTextBody;
@ -74,9 +80,13 @@ begin
CurList.AddParagraph('Text resource manager for internationalization');
CurList.AddParagraph('Automatic code formatting');
CurList.AddParagraph('The ability to create custom components');
{$endif}
Vec.WriteToFile('text_output.odt', vfODT);
Vec.WriteToFile('text_output.docx', vfDOCX);
{$ifdef pdf_test}
Vec.WriteToFile('text_output.pdf', vfPDF);
{$endif}
finally
Vec.Free;
end;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Package Version="4">
<Package Version="5">
<Name Value="fpvectorialpkg"/>
<AddToProjectUsesSection Value="True"/>
<CompilerOptions>
@ -8,8 +8,13 @@
<SearchPaths>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Other>
<ConfigFile>
<WriteConfigFilePath Value="$(PkgOutDir)/fpclaz.cfg"/>
</ConfigFile>
</Other>
</CompilerOptions>
<Files Count="26">
<Files Count="27">
<Item1>
<Filename Value="fpvectorial.pas"/>
<UnitName Value="fpvectorial"/>
@ -114,7 +119,12 @@
<Filename Value="fpvectorial2canvas.pas"/>
<UnitName Value="fpvectorial2canvas"/>
</Item26>
<Item27>
<Filename Value="pdfvectorialwriter.pas"/>
<UnitName Value="pdfvectorialwriter"/>
</Item27>
</Files>
<CompatibilityMode Value="True"/>
<RequiredPkgs Count="2">
<Item1>
<PackageName Value="LCL"/>

View File

@ -15,7 +15,7 @@ uses
rawvectorialreadwrite, svgvectorialreader_rsvg, svgvectorialwriter,
svgzvectorialreader, odtvectorialwriter, docxvectorialwriter,
htmlvectorialreader, svgvectorialreader, fpvWMF, wmfvectorialreader,
wmfvectorialwriter, fpvectorial2canvas;
wmfvectorialwriter, fpvectorial2canvas, pdfvectorialwriter;
implementation