[Module] pbPDF-Module

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] pbPDF-Module

Post by Thorsten1867 »

Bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: [Module] pbPDF-Module

Post by davido »

@Thorsten1867,
Thank you.
DE AA EB
hoerbie
Enthusiast
Enthusiast
Posts: 119
Joined: Fri Dec 06, 2013 11:57 am
Location: DE/BY/MUC

Re: [Module] pbPDF-Module

Post by hoerbie »

Hi,

I found other bugs:

1. Line 3664: PDF()\Page\Y = PDF()\Margin\Right
I think, that the Y coordinate should be set with the Top Margin and not the Right Margin.

2. In the docs it says for SetOpenAction 'Zoom in Prozent (z.B. "50%")'
Setting Zoom var to "100%" gives me a PDF with 6400% view scale and "50%" gives me 5000%, setting Zoom simply to "1" shows the PDF in 100% view scale, so I think percentage is the wrong unit.

Greetings, Hoerbie
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] pbPDF-Module

Post by Thorsten1867 »

Bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
hoerbie
Enthusiast
Enthusiast
Posts: 119
Joined: Fri Dec 06, 2013 11:57 am
Location: DE/BY/MUC

Re: [Module] pbPDF-Module

Post by hoerbie »

Thanks, but with your fix of the % bug, now you killed the use of at line 442ff predefined settings of SetOpenAction:

Code: Select all

  ;{ ----- Zoom: SetOpenAction() -----
  #PageTop   = "PageTop"
  #FullPage  = "FullPage"
  #PageWidth = "PageWidth"
  ;}
The reworked lines 4560ff

Code: Select all

      Factor = Val(RTrim(Zoom, "%")) / 100
      PDF()\Catalog\OpenAction\Zoom = StrF(Factor, 2)
should be changed to something like this (untested):

Code: Select all

      If Zoom = #PageTop Or Zoom = #FullPage Or Zoom = #PageWidth
        PDF()\Catalog\OpenAction\Zoom = Zoom
      Else
        Factor = Val(RTrim(Zoom, "%")) / 100
        PDF()\Catalog\OpenAction\Zoom = StrF(Factor, 2)
      EndIf  
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] pbPDF-Module

Post by Thorsten1867 »

Bugfix

@hoerbie
You're right, I changed it in the wrong place. Please try it again.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] pbPDF-Module

Post by Thorsten1867 »

Update: PDF::GetStringHeight() added
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: [Module] pbPDF-Module

Post by blueb »

Thorsten...

I took your pbPDF help file pbPDF-Doku_DE.pdf and converted it to English..

1 - I dropped the document unto: https://pdf2docx.com/

2 - I dropped this converted document unto: https://www.deepl.com/Translator

3 - I opened the document in Microsoft Word and saved it as a PDF.

Now I have an English version of a German Help file... cool. :mrgreen:
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: [Module] pbPDF-Module

Post by blueb »

Thorsten,

Just noticed that the command PDF::HeaderProcedure() is missing in the manual.
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] pbPDF-Module

Post by Thorsten1867 »

Update: Conversion of incompatible PNGs
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
PB_Rainer
User
User
Posts: 80
Joined: Fri Jun 07, 2019 1:56 pm

Re: [Module] pbPDF-Module

Post by PB_Rainer »

Hi Thorsten,

great piece of work, I tested it today. Unfortunately I cannot print a BMP, not as PDF:IMAGE, nor as PDF:IMAGEMEMORY. Do you see any chance to do that in future. In my programs I am working only with bmp-files (it's a MUST in the textile-industry)

Regards Rainer
User avatar
PB_Rainer
User
User
Posts: 80
Joined: Fri Jun 07, 2019 1:56 pm

Re: [Module] pbPDF-Module

Post by PB_Rainer »

Hi Thorsten,

need your help with

PDF:ImageMemory

In the manual there is something not clear: What is FileName.s and what is Name.s?

in the params there is only Name.s! What is Name.s really? Is it Name.s or FileName.s
For what are Name.s and/or FileName.s used if the image is already loaded into the memory?

Code: Select all

from your manual PDF

PDF::ImageMemory
Syntax
ImageMemory(ID.i, Name.s, *Memory, MemSize.i, Format.i, X.f, Y.f, Width.f, Height.f, Link.i)

Beschreibung
Platziert an den angegebenen Koordinaten ein im Speicher abgelegtes Bild auf der Seite.
FileName
Dateiname (und Pfad) des entsprechenden Bildes
Name
Dateiname für das Bild im Speicher
*Memory
Pointer auf die Speicheradresse des Bildes
MemSize
Größe der Bilddaten im Speicher (Bytes)
Format
#Image_PNG
- 32 -
Befehlsübersicht
#Image_JPEG
#Image_JPEG2000
X [Default: #PB_Default]
Horizontale Position der Linie. (#PB_Default = aktuelle Position)
Y [Default: #PB_Default]
Vertikale Position der Linie. (#PB_Default = aktuelle Position)
Width [Default: #PB_Default]
Breite des Bildes festlegen. (#PB_Default = Orginalgröße)
Height [Default: #PB_Default]
Höhe des Bildes festlegen. (#PB_Default = Orginalgröße)
Link [Default: #False]
Von Links, Annotations oder Actions zurückgegebene LinkID.
I tried it with this without success.

Code: Select all

DataSection
  TestImageMemory_Start:
  IncludeBinary "C:\Program Files\PureBasic\MySources\DiagonalRugs\Images\Designs\45_PP_90_DES_4.png"
  TestImageMemory_End:
EndDataSection

PDF::ImageMemory(#PDF, "MyPicture", TestImageMemory_Start, TestImageMemory_End - TestImageMemory_Start, PDF::#Image_PNG, 30, 30,100, 150, PDF::#NoLink)  
Please give a help

regards
Rainer
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: [Module] pbPDF-Module

Post by Paul »

PB_Rainer wrote:Hi Thorsten,
need your help with
PDF:ImageMemory

In the manual there is something not clear: What is FileName.s and what is Name.s?

https://www.purebasic.fr/english/viewto ... 30#p540281
Image Image
User avatar
PB_Rainer
User
User
Posts: 80
Joined: Fri Jun 07, 2019 1:56 pm

Re: [Module] pbPDF-Module

Post by PB_Rainer »

Thanks Thorsten.

Do you think you will fix it someday, and add BMP-format too?

Regards Rainer
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] pbPDF-Module

Post by Thorsten1867 »

Paul wrote:
PB_Rainer wrote:Hi Thorsten,
need your help with
PDF:ImageMemory

In the manual there is something not clear: What is FileName.s and what is Name.s?

https://www.purebasic.fr/english/viewto ... 30#p540281
Filename ist die Bilddatei, die geladen wird.
Name ist der interne Name für das Bild, da er ohne den Filename bei Memory nicht ermittelt werden kann.

Gesendet von meinem BAH2-W19 mit Tapatalk
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply