It is currently Sat Dec 14, 2019 2:58 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: [Module] PurePDF
PostPosted: Tue Sep 26, 2017 7:27 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1034
Location: Germany
I transformed the PurePDF include into a module.

Download-Link (Box.net)

Code:
; ===== Commands ==================
; PDF::AcceptPageBreak()        - Accept automatic page break or not.
; PDF::Addlink()                - Creates a new internal link and returns its identifier.
; PDF::AddPage()                - Adds a new page to the document.
; PDF::BookMark()               - Add bookmark
; PDF::Cell()                   - Prints a cell (rectangular area) with optional borders, background color and character string.
; PDF::DrawCircle()             - Draw circle
; PDF::DisplayPreferences()     - Set viewer preferences
; PDF::DrawEllipse()            - Draw ellipse
; PDF::GetErrorCode()           - Return the error code.
; PDF::GetErrorMessage()        - Return the error message.
; PDF::GetFontSize()            - Get current fontsize.
; PDF::GetMultiCellNewLines()   - Get the last value of newlines for pdf_MultiCell()
; PDF::GetNumbering()           - Return if numbering is #True/#False. Usefull for TOC functions
; PDF::GetNumberingFooter()     - Return if numbering in footer is #True/#False. Usefull for TOC functions
; PDF::Image()                  - Puts an image in the page.
; PDF::ImageMem()               - Puts an image from memory in the page.
; PDF::IncludeFileJS()          - Include JavaScript file
; PDF::IncludeJS()              - Add JavaScript code
; PDF::InsertTOC()              - Insert table of contents.
; PDF::DrawLine()               - Draws a single line between two points.
; PDF::Link()                   - Puts a link on a rectangular area of the page.
; PDF::Ln()                     - Performs a line break.
; PDF::MultiCell()              - This method allows printing text with line breaks.
; PDF::MultiCellBlt()           - Add multicell with bullet
; PDF::NumPageNum()             - Get TOC page number
; PDF::PathArc()                - Draws a cubic Bezier curve to the current path.
; PDF::PathBegin()              - Begins a new path at the coordinates (x, y).
; PDF::PathEnd()                - Closes the current path and draws a line from the current point to the starting point.
; PDF::PathLine()               - Draws a line from the current point to (x, y).
; PDF::PathRect()               - Draws a rectangle to the current path with upper-left corner (x, y) and dimensions (w, h).
; PDF::Rect()                   - Outputs a rectangle.
; PDF::ResetBookMark()          - Reset bookmarks for new document
; PDF::RoundRect()              - Outputs a rounded rectangle.
; PDF::Rotate()                 - Perform a rotation around a given center.
; PDF::Save()                   - Save PDF to filename.
; PDF::ScaleX()                 - Scaling X
; PDF::ScaleY()                 - Scaling Y
; PDF::ScaleXY()                - Scaling XY
; PDF::Sector()                 - Draw the sector of a circle.
; PDF::SetAFile()               - Defines the page and position for file annotations.
; PDF::SetALaunch()             - Defines the page and position for a launch action.
; PDF::SetAPopUp()              - Defines the page and position for PopUp annotations.
; PDF::SetAText()               - Defines the page and position for text annotations.
; PDF::SetDrawColor()           - Set color for all stroking operations.
; PDF::SetFillColor()           - Set color for all filling operations.
; PDF::SetLineWidth()           - Defines the line width.
; PDF::SetLink(                 - Defines the page and position a link points to.:
; PDF::SetDash()                - Set a dash pattern And draw dashed lines Or rectangles.
; PDF::SetFont()                - Sets the font used to print character strings.
; PDF::SetFontSize()            - Defines the size of the current font.
; PDF::SetTextColor()           - Set color for text.
; PDF::SetNumberingFooter()     - Set footer numbering true/false.
; PDF::SetX()                   - Defines the abscissa of the current position.
; PDF::SetY()                   - Moves the current abscissa back to the left margin and sets the ordinate.
; PDF::SetXY()                  - Defines the abscissa and ordinate of the current position.
; PDF::StartPageNums()          - Start TOC page numbering.
; PDF::StopPageNums()           - Stop TOC page numbering.
; PDF::SubWrite()               - Write superscripted or supscripted
; PDF::Text()                   - Prints a character string.
; PDF::TOCEntry()               - Set TOC entry
; PDF::Triangle()               - Draw Triangle
; PDF::TruncateCell()           - Prints a Cell, if text is too large it will be truncated
; PDF::Write()                  - This method prints text from the current position.
; PDF::SetProcHeader()          - Set header procedure.
; PDF::SetProcFooter()          - Set footer procedure.
; PDF::SetProcAcceptPageBreak() - Set acceptpagebreak procedure.
; PDF::SetProcCompression()     - Set compression procedure.
; PDF::SetTitle()               - Defines the title of the document.
; PDF::SetAuthor()              - Defines the author of the document.
; PDF::SetKeywords()            - Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'.
; PDF::SetCreator()             - Defines the creator of the document.
; PDF::AliasNbPages()           - Defines an alias for the total number of pages.
; PDF::GetPageNum()              - Returns the current page number.
; PDF::GetPosX()                - Returns the abscissa of the current position.
; PDF::GetPosY()                - Returns the ordinate of the current position.
; PDF::Create()                 - Begin document.
; PDF::SetDisplayMode()         - Set display mode in viewer.
; PDF::SetAutoPageBreak()       - Set auto page break mode and triggering margin.
; PDF::SetMargins()             - Set left, top and right margins.
; PDF::SetTopMargin()           - Set top margin.
; PDF::SetRightMargin()         - Set right margin.
; PDF::SetCellMargin()          - Set cell margin.
; PDF::SetLeftMargin()          - Set left margin.
; PDF::EmbedFile()              - Embeds a file into the pdf.
; PDF::GetStringWidth()         - Get width of a string in the current font.
; PDF::TextString(String$)      - Format a text string.
; PDF::GetCMargin()             - Get cell margin.
; PDF::GetRMargin()             - Get right margin.
; PDF::GetLMargin()             - Get left margin.
; PDF::GetWordSpacing()         - Get word spacing.
; PDF::SetWordSpacing()         - Set word spacing.
; PDF::GetWidth()               - Get current width of page.
; PDF::GetHeigth()              - Get current height of page.
; PDF::GetScaleFactor()         - Get scale factor.
; PDF::GetObjNum()              - Get object number
; PDF::GetFontSizePt()          - Get current fontsize in points.
; PDF::StartTransform()         - Use this before calling any transformation. (Scale, Skew, Mirror, Translate)
; PDF::StopTransform()          - Restore the normal painting and placing behaviour as it was before calling pdf_StartTransform().
; PDF::Translate()              - Translate -> right/bottom
; PDF::TranslateX(TX.f)         - Translate -> right
; PDF::TranslateY(TY.f)         - Translate -> bottom
; PDF::SkewX()                  - Skewing (angle x)
; PDF::SkewY()                  - Skewing (angle y)
; PDF::MirrorH()                - Alias for scaling -100% in x direction
; PDF::MirrorV()                - Alias For scaling -100% in y direction.
; PDF::SetLineCap()             - Sets the line cap style
; PDF::SetLineJoin()            - Sets the line join style.
; PDF::SetTextColorCMYK()       - Set Textcolor CMYK
; PDF::SetDrawColorCMYK()       - Set Drawcolor CMYK
; PDF::SetFillColorCMYK()       - Set Fillcolor CMYK
; PDF::ASCII85_Decode()         - Decodes an ASCII85 encoded buffer.
; PDF::ASCII85_Encode()         - Encodes data to ASCII85-
; PDF::ASCII85_Free()           - Frees a Databuffer that was allocated with PDF::ASCII85_Encode().
; =================================

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

Download of PureBasic - Modules

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


Last edited by Thorsten1867 on Tue Sep 26, 2017 8:58 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Module PurePDF
PostPosted: Tue Sep 26, 2017 8:13 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 14, 2014 12:09 pm
Posts: 236
THanks a lot , very usefull programm


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Sep 27, 2017 7:18 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1223
Location: germany
GREAT :!: Thank you!


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Sep 27, 2017 7:44 am 
Offline
Enthusiast
Enthusiast

Joined: Tue May 26, 2009 2:11 pm
Posts: 620
Hm, the history of this module says "Version 2.24 (13.2.2013)"
but isn't there already a version 2.25 (for PB5.2x x86)?

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Sep 27, 2017 8:14 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1109
Location: Berlin (Germany)
Great Image

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Sep 27, 2017 10:09 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Jun 01, 2012 12:20 am
Posts: 140
Great! Very usefull!!!! Thanks!!!!!


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Sep 27, 2017 10:36 am 
Offline
User
User
User avatar

Joined: Sun Nov 30, 2003 11:42 pm
Posts: 85
Location: Lisboa, Portugal
Many Thanks

_________________
http://www.navegacaoazul.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Sep 27, 2017 5:58 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4548
Location: Lyon - France
Very useful and nice module
Works perfectly here
Thanks for sharing 8)

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Wed Sep 27, 2017 11:23 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1704
Location: Germany (Saxony, Deutscheinsiedel)
Thank you very much! :D

I will try to include/use it in my project (for Win + Mac) during the next weeks... 8)

_________________
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Thu Sep 28, 2017 5:48 am 
Offline
Enthusiast
Enthusiast

Joined: Mon May 10, 2010 4:02 pm
Posts: 153
Thank you.
Can you show a simple example of using this module?


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Thu Sep 28, 2017 10:35 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 21, 2011 9:11 am
Posts: 606
Location: France
Hello kvitaliy
kvitaliy wrote:
Thank you.
Can you show a simple example of using this module?
Use the PurePDF225 examples and replace PDF_ with PDF::

Example: pdf_Create becomes PDF::Create()

■ Hello World
Code:
XIncludeFile "PurePdfModule.pbi"

Define file$="Tutorial01 Hello World.pdf"

UseModule PDF

PDF::Create()
PDF::AddPage()
PDF::SetFont("Arial","B",16)
PDF::Cell(40,10,"Hello World!",1)
PDF::Save(file$)

RunProgram(file$)

■ Header & Footer
Code:
XIncludeFile "PurePdfModule.pbi"

UseModule PDF

Procedure Header()
  PDF::SetFont("Arial","B",15)
  PDF::Cell(80)
  PDF::Cell(30,10,"Title",1,0, PDF::#ALIGN_CENTER)
  PDF::Ln(20)
EndProcedure

Procedure Footer()
  PDF::SetY(-15)
  PDF::SetFont("Arial","I",8)
  PDF::Cell(0,10,"Page "+Str(PDF::GetPageNum())+"/{nb}",0,0,PDF::#ALIGN_CENTER)
EndProcedure

Define file$="Tutorial02 Header-Footer.pdf"
Define i

PDF::Create()
PDF::SetProcFooter(@Footer())
PDF::SetProcHeader(@Header())
PDF::AliasNbPages();

PDF::AddPage();
PDF::SetFont("Times","",12);

For i = 1 To 40
  PDF::Cell(0,10,"Printing line number "+Str(i),0,1);
Next

PDF::Save(file$)
RunProgram(file$)

_________________

➽ 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: Thu Sep 28, 2017 10:40 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 21, 2011 9:11 am
Posts: 606
Location: France
Hello Thorsten

The procedure AliasNbPages() is not public. I modified the source you provided.
Quote:
Declare SetCreator(Creator$)
Declare AliasNbPages(Alias$="{nb}")
Declare.l GetPageNum()

Thank you for this module.

_________________

➽ 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: Thu Sep 28, 2017 12:43 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 14, 2014 12:09 pm
Posts: 236
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


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Thu Sep 28, 2017 3:06 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon May 10, 2010 4:02 pm
Posts: 153
falsam, thanks for a simple example!


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] PurePDF
PostPosted: Thu Sep 28, 2017 7:25 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1034
Location: Germany
kvitaliy wrote:
Thank you.
Can you show a simple example of using this module?


Look at the end of the code and comple it.

Gesendet von meinem KFDOWI mit Tapatalk

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

Download of PureBasic - Modules

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


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 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