It is currently Tue Mar 09, 2021 9:55 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Tue Oct 20, 2020 1:55 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 3:57 pm
Posts: 572
Location: England
Hi,

In the PageFormat example

Code:
XIncludeFile "..\pbPDFModule.pbi"

Define File$="pbPDF-PageFormat.pdf"

#PDF = 1

Procedure Header()
  PDF::SetFont(#PDF, "Arial","B", 15)
  PDF::SetPosX(#PDF, PDF::GetPageWidth(#PDF) / 2 - 15)
  PDF::Cell(#PDF, "Title", 30, 10, 1, 0, PDF::#CenterAlign)
  PDF::Ln(#PDF, 20)
EndProcedure

Procedure Footer()
  PDF::SetFont(#PDF, "Arial", "I", 8)
  PDF::SetPosY(#PDF, -15)
  PDF::Cell(#PDF, "Page {p} / {t}", #False, 10, #False, PDF::#Right, PDF::#CenterAlign)
EndProcedure

If PDF::Create(#PDF)
 
  PDF::SetAliasTotalPages(#PDF, "{t}")
 
  PDF::SetHeaderProcedure(#PDF, @Header()) 
  PDF::SetFooterProcedure(#PDF, @Footer())

  PDF::AddPage(#PDF)
  PDF::SetFont(#PDF, "Arial", "B", 16)
  PDF::Cell(#PDF, StrF(PDF::GetPageWidth(#PDF), 0) + "x" + StrF(PDF::GetPageHeight(#PDF), 0) + " mm", 40, 10, #True)
 
  PDF::AddPage(#PDF, "L", PDF::#Format_A4)
  PDF::SetFont(#PDF, "Arial", "B", 16)
  PDF::Cell(#PDF, StrF(PDF::GetPageWidth(#PDF), 0) + "x" + StrF(PDF::GetPageHeight(#PDF), 0) + " mm", 40, 10, #True)
 
  PDF::AddPage(#PDF, "L", PDF::#Format_A5)
  PDF::SetFont(#PDF, "Arial","B", 16)
  PDF::Cell(#PDF, StrF(PDF::GetPageWidth(#PDF), 0) + "x" + StrF(PDF::GetPageHeight(#PDF), 0) + " mm", 40, 10, #True)

  PDF::AddPage(#PDF, "P", PDF::#Format_A6)
  PDF::SetFont(#PDF, "Arial", "B", 16)
  PDF::Cell(#PDF, StrF(PDF::GetPageWidth(#PDF), 0) + "x" + StrF(PDF::GetPageHeight(#PDF), 0) + " mm", 40, 10, #True)
 
  PDF::Close(#PDF, File$)
EndIf

RunProgram(File$)


Yuo have the procedures for header and footer which i presume should automaticaly be applied to each page after using
Code:
  PDF::SetHeaderProcedure(#PDF, @Header()) 
  PDF::SetFooterProcedure(#PDF, @Footer())


However I get neither a header or footer on any page when i run the example.

Is this an error or am i doing something wrong ?

I'm using Win10 PRO x64 and Adobe Reader DC.

Cheers


Top
 Profile  
Reply with quote  
 Post subject: Re: Moving inside the PDF File ; How to ?
PostPosted: Tue Oct 20, 2020 9:35 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Apr 20, 2012 8:09 pm
Posts: 299
loulou2522 wrote:
I don't know how to do the following:
I'm on page 2 of my PDF and would like to go back to Page One to add text at a defined position and then go back to Page Two and continue processing. Is this possible?

once you create a new page the previous page is finalized. I set up my pages with a structure, and when I have all data then I create the final PDF.
This does sound interesting since the PDF page is just saved in memory, you'll have to reserve some space for the object, just like footer works. ( When I have time I'll take a look, but don't hold your breath)

@captain_skank
The PageFormat example is missing some code just after you set the procedures:
Code:
  PDF::SetHeaderProcedure(#PDF, @Header())
  PDF::SetFooterProcedure(#PDF, @Footer())

  PDF::EnableFooter(#PDF, #True)   :ADD
  PDF::EnableHeader(#PDF, #True)   ;ADD
  PDF::SetPageNumbering(#PDF, #True) ;ADD


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  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Wed Oct 21, 2020 9:25 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 3:57 pm
Posts: 572
Location: England
Thanks Norm.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Wed Oct 21, 2020 10:31 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 3:57 pm
Posts: 572
Location: England
Right another PDF dumba$$ question.

When using
Code:
PDF::MultiCell
how do you force a line break manualy ??

The help doc doesn't mention it and the original purePDF help states a linebreak can be explicitly made but doesn't say how.

Tried adding #CRLF$ or #LF$ to the string also tried including /r \r /n \n into the string but no joy.

Anybody got a clue ? :oops:

Cheers


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Wed Oct 21, 2020 8:02 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Apr 20, 2012 8:09 pm
Posts: 299
That's odd, #LF$ should work, here's an example

pbPDF-Multiline.pb

Code:
XIncludeFile "..\pbPDFModule.pbi"

Define File$="pbPDF-Multiline.pdf"
Define Text$, i.i
;{ These constants are defined in the module, but they did not work on my example, and I wanted a border
  #Border       = #True
  #LeftBorder   = -1
  #TopBorder    = -2
  #RightBorder  = -4
  #BottomBorder = -8
;} 
#PDF = 1


If PDF::Create(#PDF)
 
 
  PDF::AddPage(#PDF)
 
  PDF::SetFont(#PDF, "Arial", "", 12)
 
  Text$ = "PureBasic:"+#LF$+ "Is a programming language based on established BASIC rules. The key features of PureBasic are portability "
  Text$ + "(Windows, AmigaOS and Linux are currently fully supported), "+#LF$+#LF$+ "the production of very fast and highly optimized executables "
  Text$ + "and, of course, the very simple BASIC syntax. PureBasic has been created for the beginner and expert alike. We have put "
  Text$ + "a lot of effort into its realization to produce a fast, reliable and system friendly language."
 

  PDF::Cell(#PDF,"JUST A CELL"+#LF$+ " WITH NO BREAK",70,15,#Border)
  PDF::ln(#PDF)
  PDF::MultiCell(#PDF,Text$,100,5,#Border)
  PDF::ln(#PDF)
  PDF::Write(#PDF,"It also works"+#LF$+ " with write!!!")
  PDF::Close(#PDF, File$)
 
EndIf

RunProgram(File$)


I hope that helps.

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  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Wed Oct 21, 2020 9:27 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 3:57 pm
Posts: 572
Location: England
Again thanks Norm, not sure why it didn't work when i tried it.

Although I may have misunderstood the height property so set it at 20, so when I tried it using #LF$ I just got a one line cell :oops: making me think it didn't work.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Thu Dec 03, 2020 8:47 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 14, 2014 12:09 pm
Posts: 356
Would it be possible to have a programming example with two form text fields A1 and A2 with javascript copying from field A1 to A2 when field A1 changes content. Thank you in advance


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Wed Dec 16, 2020 12:25 am 
Offline
New User
New User

Joined: Mon Dec 14, 2020 12:49 pm
Posts: 8
Hello,

Its possible to make a pdf with Digital Signature Timestamping (TSA) ?


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

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