Recent

Author Topic: Pdf Viewer in Pascal  (Read 3037 times)

Dzandaa

  • Hero Member
  • *****
  • Posts: 557
  • From C# to Lazarus
Re: Pdf Viewer in Pascal
« Reply #15 on: June 18, 2026, 11:20:08 am »
Hi,

@Tomxe:

Thanks, I'll keep testing, I'll let you know if I find anything else.
It's a shame there isn't a Linux version.  :D :D
Regards,
Dzandaa

Tomxe

  • Full Member
  • ***
  • Posts: 134
Re: Pdf Viewer in Pascal
« Reply #16 on: June 19, 2026, 07:58:50 am »
I tried a few documents, usually there are issues with some characters. But in the attached file I see only quadrangles.
Fixed now

docno

  • New Member
  • *
  • Posts: 19
Re: Pdf Viewer in Pascal
« Reply #17 on: June 19, 2026, 08:41:35 am »
Hello,
i cant compile demo_pdf.lpi width lazarus 4.8 FPC 3.2.4

What have i missing ?

Thx for any help.

Quote
Hint: (11030) Start of reading config file E:\perso\dev\lazarus\fpc\3.2.4\bin\x86_64-win64\fpc.cfg
Hint: (11031) End of reading config file E:\perso\dev\lazarus\fpc\3.2.4\bin\x86_64-win64\fpc.cfg
Free Pascal Compiler version 3.2.4-rc1 [2026/06/06] for x86_64
Copyright (c) 1993-2026 by Florian Klaempfl and others
(1002) Target OS: Win64 for x64
(3104) Compiling DEMO_PDF.lpr
(3104) Compiling unit1.pas
(3104) Compiling PdfParser.pas
(3104) Compiling PdfBitmapRenderer.pas
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(286,19) Hint: (5094) Function result variable of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(463,23) Error: (5000) Identifier not found "CFFCidToGid"
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(641,17) Error: (5038) identifier idents no member "GlyphIDs"
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(644,17) Hint: (5091) Local variable "gids" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(645,15) Hint: (5091) Local variable "dx" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(649,14) Error: (5038) identifier idents no member "GlyphIDs"
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(655,24) Error: (5038) identifier idents no member "GlyphAdv"
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(734,16) Error: (5038) identifier idents no member "GlyphIDs"
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(768,16) Hint: (5057) Local variable "Xf" does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(894,16) Hint: (5091) Local variable "buf" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(943,18) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(984,21) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1021,21) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1054,21) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1095,21) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1152,24) Hint: (5091) Local variable "Pts" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1303,21) Hint: (5091) Local variable "Counts" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1308,23) Hint: (5091) Local variable "AllPts" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1512,21) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1513,45) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1647,23) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1903,21) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1904,21) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1949,18) Hint: (5091) Local variable "Pts" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1950,21) Hint: (5091) Local variable "Counts" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1993,17) Hint: (5091) Local variable "srow" of a managed type does not seem to be initialized
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1994,42) Warning: (5044) Symbol "ScanLine" is not portable
E:\perso\dev\laz_perso\perso\pdf\PdfBitmapRenderer.pas(1998,18) Warning: (5044) Symbol "ScanLine" is not portable
PdfBitmapRenderer.pas(2163) Fatal: (10026) There were 5 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: E:\perso\dev\lazarus\fpc\3.2.4\bin\x86_64-win64\ppcx64.exe returned an error exitcode




Tomxe

  • Full Member
  • ***
  • Posts: 134
Re: Pdf Viewer in Pascal
« Reply #18 on: June 19, 2026, 08:48:39 am »
One file in the repo was older than my local copy, sorry about that. Please redownload files.

CM630

  • Hero Member
  • *****
  • Posts: 1743
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Pdf Viewer in Pascal
« Reply #19 on: June 19, 2026, 10:21:18 am »
I tried a few documents, usually there are issues with some characters. But in the attached file I see only quadrangles.
Fixed now
Thanks, it is much better now.
Still there are some differences, marked in yellow rectangles in the attached screenshot.
On the left is your tool, on the right is Sumatra Pdf. I have also opened the file with Foxit reader- it shows the same as Sumatra.
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

Dzandaa

  • Hero Member
  • *****
  • Posts: 557
  • From C# to Lazarus
Re: Pdf Viewer in Pascal
« Reply #20 on: June 19, 2026, 10:22:14 am »
Hi
@Tomxe:

New errors:

PdfBitmapRenderer.pas at line 434
for I := 0 to High(Data) do Sig := Sig * 31 + Data;


PdfCFF at line 441:
Result := Result + w;

Good luck

B->
Regards,
Dzandaa

Tomxe

  • Full Member
  • ***
  • Posts: 134
Re: Pdf Viewer in Pascal
« Reply #21 on: June 19, 2026, 11:08:16 am »
Hi
@Tomxe:

New errors:

PdfBitmapRenderer.pas at line 434
for I := 0 to High(Data) do Sig := Sig * 31 + Data;


PdfCFF at line 441:
Result := Result + w;

Good luck

B->
Are you sure you have the newest files from the repo? I don't see these errors.

Dzandaa

  • Hero Member
  • *****
  • Posts: 557
  • From C# to Lazarus
Re: Pdf Viewer in Pascal
« Reply #22 on: June 19, 2026, 12:23:27 pm »
Hi,
@Tomxe,

Quote
Are you sure you have the newest files from the repo? I don't see these errors.

I hope, I download it from github this morning.

it works on  some PDF but some have this error.

B->
Regards,
Dzandaa

Tomxe

  • Full Member
  • ***
  • Posts: 134
Re: Pdf Viewer in Pascal
« Reply #23 on: June 19, 2026, 08:34:18 pm »
On the left is your tool, on the right is Sumatra Pdf. I have also opened the file with Foxit reader- it shows the same as Sumatra.
Thanks, fixed.

Dzandaa

  • Hero Member
  • *****
  • Posts: 557
  • From C# to Lazarus
Re: Pdf Viewer in Pascal
« Reply #24 on: June 20, 2026, 01:38:45 pm »
Hi,
@Tomxe:

It gave me errors in debug mode Dwarf 2 or Dwarf 3

B->
Regards,
Dzandaa

Tomxe

  • Full Member
  • ***
  • Posts: 134
Re: Pdf Viewer in Pascal
« Reply #25 on: June 20, 2026, 02:33:44 pm »
Hi,
@Tomxe:

It gave me errors in debug mode Dwarf 2 or Dwarf 3

B->

It works fine on my test pdfs so I cannot debug that. Perhaps you could share your problematic pdfs?

eldonfsr

  • Hero Member
  • *****
  • Posts: 598
Re: Pdf Viewer in Pascal
« Reply #26 on: June 20, 2026, 09:53:25 pm »
Is great job but i don't see option to print ?  could be avalible in future?


Tomxe

  • Full Member
  • ***
  • Posts: 134
Re: Pdf Viewer in Pascal
« Reply #27 on: June 21, 2026, 11:00:55 am »
It can print now

Dzandaa

  • Hero Member
  • *****
  • Posts: 557
  • From C# to Lazarus
Re: Pdf Viewer in Pascal
« Reply #28 on: June 21, 2026, 12:09:49 pm »
Hi
@Tomxe:

Here is a little program i wrote to see multiple .pdf in a directory.

It is not finished but  you can try it and compare if the XelPDF version is the same.

Also include a PDF that create crash.

B->
Regards,
Dzandaa

Tomxe

  • Full Member
  • ***
  • Posts: 134
Re: Pdf Viewer in Pascal
« Reply #29 on: June 21, 2026, 01:11:57 pm »
Pdfs that crash in your app work perfectly fine in the DEMO_PDF.lpr
Interesting!

 

TinyPortal © 2005-2018