Page 10 of 10
Re: [Module] pbPDF-Module
Posted: Fri Jun 07, 2024 10:31 am
by Lord
Hi!
First of all I'm still using PurePDF V2.26 (Normeus) with PurePDF-A3.pb.
https://www.purebasic.fr/english/viewto ... 82#p573182
I now have to switch from Win7x64 (RIP) to Win11x64 and got a lot of trouble.
One thing is that I now get an IMA in PurePDF-A3.pb in
Procedure.i ipdf_TTF_SearchTagName(*TTF_Memory.TTF_Header,TagName.s)
where
Version = ipdf_EndianL(*TTF_Memory\sfnt_version)
gives that error.
Debugging *TTF_Memory shows that the adress is not zero.
I used on my older machine Win7 with PB 6.10x64 and C backend. There the
code is still compiling and running without any problem.
Now I have the same setting but on Win11x64.
The in structure TTF_Header sfnt_version is defined as long. I changed it
to integer but that didn't help.
Any ideas what changed from win7 to win11 that can cause this error?
A change to another PDF-modul or the new PDF-functions in PB is not
an alternative. My program is only for my private use and has over
the years grown to more than 20000 lines of code (without the includes).
Please help.
Lord
Re: [Module] pbPDF-Module
Posted: Sat Jun 08, 2024 3:31 pm
by Lord
Still need help.
But a first success in finding the problem(s).
In Procedure ipdf_Get_Font() line "PokeL(*Buffer,Mem)" is wrong.
This should be a "PokeI(*Buffer,Mem)".
This bug caused the IMA in Procedure ipdf_TTF_SearchTagName()
because *TTF_Memory here was invalid (32bit instead 64 bit).
Now I get an IMA in ipdf_GetStringWidth():
Glyph=ipdf_EndianW(Fonts()\cidtogidmap\segment[Char])&$FFFF
I don't know, why all this wasn't a problem in Win7.
Any ideas?
Re: [Module] pbPDF-Module
Posted: Sun Jun 09, 2024 9:51 am
by mk-soft
The memory management has changed. Memory pointers should always be defined as integers or pointers.
Before the old OS or compiler had the pointer fit into a long. With the new safe memory management this is no longer possible.
Many had taken the type long (when there was only 32bit or did not pay attention).
Re: [Module] pbPDF-Module
Posted: Sun Jun 09, 2024 10:05 am
by Thorsten1867
I can hardly correct errors in procedures that do not exist in my module.
You should post your problems at PurePDF and not at pbPDF.
As mk-soft has already described, the code must be adapted to 64Bit, as I have done with pbPDF.
Re: [Module] pbPDF-Module
Posted: Sun Jun 09, 2024 10:10 am
by mk-soft
Besides, you are in the wrong post and has nothing to do with the pbPDF module, but with the PurePDF.
The pbPDF does not have this error.
The admin should separate this from here.
Re: [Module] pbPDF-Module
Posted: Sun Jun 09, 2024 10:22 am
by Lord
Thanks to both of you for your answers.
Thorsten1867 wrote: Sun Jun 09, 2024 10:05 am
I can hardly correct errors in procedures that do not exist in my module.
You should post your problems at PurePDF and not at pbPDF.
As mk-soft has already described, the code must be adapted to 64Bit, as I have done with pbPDF.
OK, but why does it happen? I use the same PBv6.10x64 on Win7 and Win 11.
I copied the still on my old sytem stored PB-installer for 6.10 to my new machine, also the source code.
So the difference is only the Windows version.
Re: [Module] pbPDF-Module
Posted: Sun Jun 09, 2024 10:36 am
by mk-soft
@Lord
The OS memory management has changed too.
Have you already run pbPDF ? Not PurePDF
Re: [Module] pbPDF-Module
Posted: Mon Jun 10, 2024 7:24 am
by Lord
mk-soft wrote: Sun Jun 09, 2024 10:36 am...
Have you already run pbPDF ? Not PurePDF
Yes, I tried to switch the PDF part of my program.
As I already mentioned, my program has more than 20k of codelines
and more than 3k for the pdf part. I tried to rewrite it but had
no success. To many changes.
Re: [Module] pbPDF-Module
Posted: Mon Jun 10, 2024 10:55 pm
by normeus
@lord, This is the pbPDF-Module thread, you should post on the PurePDF thread. Anyway since pbPDF was running fine on w7 and it fails now on windows 11, I would assume is a missing font error ( the procedure you mentioned deals with fonts ). check to make sure the fonts you used on windows 7 are installed in windows 11 and also install fonts systemwide otherwise they will be installed on your personal folder. pbPDF and also PurePDF will not be able to find the font there unless you specify the full path of the font.
Norm.
P.S.
If I do not reply within a couple of days send me a PM. Sometimes I miss posts.
Re: [Module] pbPDF-Module
Posted: Tue Jun 11, 2024 9:49 am
by Lord
Hi Normeus!
I'm happy to tell you that I got my program working again.
I have tried some fonts that are available on my Win7 and Win11 computer.
All turned out to produce the same error except one font.
It turned out that only Helvetica and Arial seem to work without producing an IMA.
Arial is present on only some locations in my program. Mostly I used MS Sans Serif Standard.
After switching from MS Sans Serif Standard to Helvetica everything is working.
My first tought was, that for any reason only Fonts are available wich are defined PurePDF-A3.pb,
but Arial is there not mentioned, only Helvetica.
Anyway. As I said, I'm happy that my 'little' program is running again.
Thank you for giving me the right direction.
Re: [Module] pbPDF-Module
Posted: Wed Jun 12, 2024 9:04 am
by Jan2004
normeus Thank you for your answer. Only now, from Apr 07, 2024 10:50 am. I looked at this post - hence my delay in thanking you.