DynaPDF Manual - Page 170

Previous Page 169   Index   Next Page 171

Function Reference
Page 170 of 839
function ErrProc(const Data: Pointer; ErrCode: Integer; const ErrMessage:
PAnsiChar; ErrType: Integer): Integer; stdcall;
var s: String;
begin
s := Format('%s'#13'Abort processing?', [ErrMessage]);
if MessageDlg(s, mtError, [mbYes, mbNo], 0) = mrYes then
Result := -1 // break processing
else Result := 0; // try to continue
end;
procedure TForm1.Button1Click(Sender: TObject);
var pdf: TPDF;
begin
try
pdf := TPDF.Create;
pdf.SetOnErrorProc(nil, @ErrProc);
pdf.SetDocInfoA(diAuthor, 'Jens Boschulte');
pdf.SetDocInfoA(diCreator, 'Delphi sample project');
pdf.SetDocInfoA(diSubject, 'How to use ContinueText');
pdf.SetDocInfoA(diTitle, 'ContinueText');
pdf.SetViewerPreferences(vpDisplayDocTitle, avNone);
pdf.CreateNewPDFA('c:\dout.pdf');
pdf.Append;
pdf.SetFontA('Arial', fsNone, 12, true);
pdf.ChangeFontStyle(fsUnderlined);
pdf.BeginContinueText(50, 780);
pdf.AddContinueTextA('Underlined text...');
pdf.ChangeFontStyle(tsNone);
pdf.AddContinueTextA('Normal text!');
pdf.ChangeFontStyle(fsStriked);
pdf.AddContinueTextA('Strikeout text!');
pdf.EndContinueText;
pdf.EndPage;
pdf.CloseFile;
except
on E: Exception do MessageDlg(E.Message, mtError, [mbOK], 0);
end;
pdf.Free;
end;
Output:
Underlined text…
Normal text!
Strikeout text!
 

Previous topic: BeginClipPath (Obsolete), BeginContinueText

Next topic: BeginLayer