It is currently Fri Nov 15, 2019 8:00 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: [Module] PurePDF
PostPosted: Thu Sep 28, 2017 7:40 pm 
Online
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 934
Location: Germany
loulou2522 wrote:
Problem with

Code:
Structure MEM_DataStructure
   pData.i       ; Pointer to memory
   lMaxSize.i    ; Max. reserved memory in bytes
   lCurSize.i    ; Current last possition of data in bytes
 EndStructure


Purebasic say
Structure yet declared in a residant file


Changed:

Code:
CompilerIf Defined(MEM_DataStructure,#PB_Structure)=0
    Structure MEM_DataStructure
      pData.i       ; Pointer to memory
      lMaxSize.i    ; Max. reserved memory in bytes
      lCurSize.i    ; Current last possition of data in bytes
    EndStructure
  CompilerEndIf

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Thu Sep 28, 2017 9:40 pm 
Online
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 934
Location: Germany
Update:
- Bugfixes
- Examples (Tutorial 1-32) added

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Fri Sep 29, 2017 9:05 am 
Offline
Enthusiast
Enthusiast

Joined: Tue May 26, 2009 2:11 pm
Posts: 603
The question still stands:
Is this modul a derivate from PurePDF v2.24 or v2.25?

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Fri Sep 29, 2017 9:09 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 21, 2011 9:11 am
Posts: 606
Location: France
I tested all the examples. Thank you for sharing. ^-^

Small minor errors in these three tutorials.

Tutorial02
Module item 'SetY()' Not found.
changed: pdf_SetY() => PDF::SetPosY()


Tutorial03 - Tutorial04
Module item 'SetX()' not found.
changed: pdf_SetX() => PDF::SetPosX()

Module item 'SetY()' not found.
changed: pdf_SetY() => PDF::SetPosY()

_________________

➽ Windows 10 - PB 5.62 & PB 5.70 LTS

Sorry for my bad english and the Dunning–Kruger effect.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Fri Sep 29, 2017 12:07 pm 
Online
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 934
Location: Germany
falsam wrote:
I tested all the examples. Thank you for sharing. ^-^

Small minor errors in these three tutorials.

Tutorial02
Module item 'SetY()' Not found.
changed: pdf_SetY() => PDF::SetPosY()


Tutorial03 - Tutorial04
Module item 'SetX()' not found.
changed: pdf_SetX() => PDF::SetPosX()

Module item 'SetY()' not found.
changed: pdf_SetY() => PDF::SetPosY()


==> fixed

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Sat Sep 30, 2017 2:33 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue May 26, 2009 2:11 pm
Posts: 603
Are there any reason to ignore my questions?
viewtopic.php?p=512589#p512589
and
viewtopic.php?p=512709#p512709

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Sun Oct 01, 2017 1:46 pm 
Online
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 934
Location: Germany
Upgrade PurePdfModule to PurePDF V2.26.

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Sun Oct 01, 2017 1:48 pm 
Online
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 934
Location: Germany
Lord wrote:
Are there any reason to ignore my questions?
viewtopic.php?p=512589#p512589
and
viewtopic.php?p=512709#p512709


It based now on PurePDF V2.26.

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Mon Oct 02, 2017 9:23 am 
Offline
Enthusiast
Enthusiast

Joined: Tue May 26, 2009 2:11 pm
Posts: 603
Thorsten1867 wrote:
...
It based now on PurePDF V2.26.
Thanks for this information.

Still:
Help file says:
History wrote:
History

Version 2.24 (13.2.2013)
...
So what are the changes from 2.24 to 2.25 to 2.26?
Where can I find the original PurePDF v2.26?

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Mon Oct 09, 2017 7:19 am 
Online
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 934
Location: Germany
The help file belongs to the original PurePDF include.

Gesendet von meinem Aquaris X mit Tapatalk

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Mon Oct 09, 2017 7:22 am 
Online
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 934
Location: Germany
viewtopic.php?p=504002#p504002

Gesendet von meinem Aquaris X mit Tapatalk

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Tue Nov 28, 2017 4:54 pm 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1032
Location: Portugal
Hi

Great module

Just one problem. I am trying to add images to a pdf document and it seems to fail.

Here is my test code

Code:
IncludeFile "PurePdfModule.pbi"

PDF::Create()

PDF::AddPage()

PDF::Image("165134.jpg",80,80,50,50)
;PDF::Image("PurePDFLogo.jpg",80,80,50,50)
File$ = "Test.pdf"
PDF::Save(file$)
RunProgram(file$)


When I use the PurePDFLogo.jpg it works using any other jpg image it fails.

Any Ideas?

collectordave

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Tue Nov 28, 2017 5:59 pm 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1032
Location: Portugal
Managed to get images on the page using imagemem
Code:
UseJPEGImageDecoder()
UseJPEGImageEncoder()

IncludeFile "PurePdfModule.pbi"

PDF::Create("","mm",PDF::#PAGE_FORMAT_A4)

PDF::AddPage()

StampImageID = LoadImage(#PB_Any,"165134.jpg")


;????????????????/
ResizeImage(StampImageID,590,250)

*Buffer = EncodeImage(StampImageID,#PB_ImagePlugin_JPEG)

PDF::ImageMem("165134.jpg",*Buffer,MemorySize(*Buffer),0,10)

File$ = "Test.pdf"
PDF::Save(file$)
RunProgram(file$)


Now the only thing is to get the image to fit in a standard 30mm X 30mm size. So now what size do I resize the image to get it to fit in a 30 X 30 box? Aspect ratio etc no bother.

Cheers

CD

Hm PS

Imagemem does it for you! Just need to read a little deeper.
PDF::ImageMem("165134.jpg",*Buffer,MemorySize(*Buffer),0,10,30,30)

_________________
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Jan 31, 2018 4:14 pm 
Offline
User
User

Joined: Wed Jan 31, 2018 4:03 pm
Posts: 11
Hi Thorsten1867,

Not sure if you feel like the PurePDF maintainer now. So, if not, that's OK.

My question is around pdf_SetAFile()
According to manual and examples, this needs a FileID which, in turn, is returned by a call to pdf_EmbedFile()
(The manual does not document any return value for pdf_EmbedFile, btw.)

So, this all works as expected, BUT:
The resulting PDF has the same file embedded twice:
Once from pdf_EmbedFile() and once again caused by pdf_SetAFile().
You can see that in the PDF created by example "tutorial29" where the "20k_c1.txt" is embedded twice.

This seems a waste. Is there any way to create a pdf_SetAFile with just one copy of the embedded file ?
could you put the return value of PB's ReadFile() into pdf_SetAFile() ?

Thank you,
Wolfgang2


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Jan 31, 2018 6:04 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Apr 20, 2012 8:09 pm
Posts: 283
the "SetA" commands are "Anotations"
Code:
pdf_SetAText
pdf_SetAPopUp
pdf_SetAFile


pdf_EmbedFile() is a separate command which attaches a file at the end of your pdf.

If you are doing pdf_SetAFile then it takes the fileid created by pdf_EmbedFile and uses it
from the example:
Code:
Define fileid=pdf_EmbedFile("20k_c1.txt","Attachments Pane")
link = pdf_Addlink()
pdf_SetAFile(link,fileid,-1,0,"Beschreibung","Der Titel",5,5,Date(),"Tag",0)
pdf_Cell(80,10,"This is a File annotation",1,1,#PDF_ALIGN_LEFT,#True,link)

Define file$="Tutorial29 Annotations+Actionsa.pdf"

try this code to display link 2x for the same file
Code:
Define fileid=pdf_EmbedFile("20k_c1.txt","Attachments Pane")
link = pdf_Addlink()
pdf_SetAFile(link,fileid,-1,0,"Beschreibung","Der Titel",5,5,Date(),"Tag",0)
pdf_Cell(80,10,"This is a File annotation",1,1,#PDF_ALIGN_LEFT,#True,link)
pdf_SetAFile(link,fileid,-1,0,"Beschreibung","Der Titel",5,5,Date(),"Tag",0)
pdf_Cell(80,10,"This is other File annotation",1,1,#PDF_ALIGN_LEFT,#True,link)

Define file$="Tutorial29 Annotations+Actionsa.pdf"

if you look at the output pdf it will be the same size as the previous pdf

Norm.

_________________
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye