↗https://github.com/Xelitan/PDF-Viewer-exporter-in-pure-Free-Pascal-Lazarus-Delphi
Licence: GNU/GPL, © 2026 Xelitan.com
Commercial licenses available,
starting at $100 (single developer, up to 5 programs)
uses ... PdfParser, PdfBitmapRenderer, XelPDF;
type
TForm1 = class(TForm)
public
PDF: TXelPDF;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
PDF := TXelPDF.Create(Form1);
Pdf.Parent := Form1;
Pdf.Align := alClient;
Pdf.AutoFit := afWidth; //fit to width of the component
Pdf.LoadFromFile('test.pdf');
end;
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
Pdf.Free;
end;
PDF := TXelPDF.Create(Form1);
Pdf.LoadFromFile('input.txt');
Pdf.Document.SaveToFile('txt.pdf');
TotalFonts := PDF.Document.CountFonts; //count fonts in the PDF
PDF.Document.ExportFont(5, 'out.otf'); //5 is the number of the font
//images that are embedded as JPEGs in the PDF- no recompression, except CMYK->RGB
Total := Doc.JpegsCount(PageNumber);
Doc.ExportJpeg(PageNumber, JpegNumber, 'out.jpg');
Other images:
//images that are embedded in other formats in the PDF- conversion to PNG
Total := Doc.ImagesCount(PageNumber);
Doc.ExportImage(PageNumber, ImageNumber, 'out.png');
Total := Doc.VectorGroupsCount(PageNumber);
Doc.ExportVectorGroup(PageNumber, ImageNumber, 'out.svg');
Doc.DrawRect(0, 50, 600, 200, 80, clRed); //PageNum, Left, Top, Width, Height, Color
Doc.RenderPageToPng(PageNumber, 'out.png');
F := TFileStream.Create('another.pdf', fmOpenRead);
Doc.ImportPDF(F, 0, 0, 0);
Doc.RemovePage(PageIndex);
Doc.AddPage(Width, Height);
Doc.SaveToStream(Str: TStream);
Doc.SaveToFile('output.pdf');
Doc.AddJpegImage(PageIndex, JpegBytes, Left, Top, Width, Height);
FontRes := Doc.AddFont(FontName, FontSize);
Doc.AddText(PageIndex, 'Test Here', Left, Top, FontRes);
Doc.ExtractTextToFile(PageIndex, 'output.txt');
Printing, rotating, extracting text, removing pages.
Supports:
Stream filters:
Images: