PureBasic Forum
http://forums.purebasic.com/english/

VecVi - Create and output documents using VectorDrawing lib
http://forums.purebasic.com/english/viewtopic.php?f=12&t=69804
Page 1 of 1

Author:  Andesdaf [ Tue Dec 19, 2017 8:13 pm ]
Post subject:  VecVi - Create and output documents using VectorDrawing lib

Hi,

I've written this for another project where I needed a print preview and some advances features for creating
documents (and later print them or save them to pdf) like automatic page breaks, headers, footers etc.

Main features:
  • creating a document once and later output it to CanvasGadet, Window, Image, printer, pdf (not windows) or svg (only Linux)
  • text and image cells with custom border, filling, text alignment, font etc.
  • horizontal, vertical and free lines
  • rectangles, curves, ellipses and ellipse segments
  • auto-invoked headers and footers, for the whole document or for a single page
  • auto page breaks
  • avoiding page breaks within connected element blocks
  • auto page numbers with free start value, excluding of pages from numbering, total number of pages etc.
  • possibility to display the document as single pages or as a list of pages (for print preview, see example code)

It's still work in progress and not tested in all cases, but I think I'ts already useable.

code: https://raw.githubusercontent.com/hgzh/ ... r/VecVi.pb
example: https://raw.githubusercontent.com/hgzh/ ... preview.pb

Image

Author:  collectordave [ Wed Dec 20, 2017 4:36 am ]
Post subject:  Re: VecVi - Create and output documents using VectorDrawing

Nice work.

Did you try

http://www.purebasic.fr/english/viewtopic.php?f=12&t=67703

The purePDF module on the forum can also be used to create PDF documents on windows systems.

Regards

CD

Author:  Kwai chang caine [ Thu Dec 21, 2017 6:05 pm ]
Post subject:  Re: VecVi - Create and output documents using VectorDrawing

Thanks a lot for sharing this great code 8)
Works fine here W7 x86 / V5.61 x86

Author:  Andre [ Sat Dec 23, 2017 12:02 am ]
Post subject:  Re: VecVi - Create and output documents using VectorDrawing

Very interesting! Runs fine here on Win10, thank you :D

Author:  Andesdaf [ Fri Feb 01, 2019 6:22 pm ]
Post subject:  Re: VecVi - Create and output documents using VectorDrawing

After a long time, I uploaded a new version with some smaller bug fixes and
a new output channel (image on canvas) to improve performance.

I've also written a fork of VecVi that uses PurePDF to create pdf files on windows,
if someone is interested in this, I can publish it, too.

Author:  skywalk [ Fri Feb 01, 2019 7:20 pm ]
Post subject:  Re: VecVi - Create and output documents using VectorDrawing

This has potential as a Report Generator. 8)
Not sure why pdf would not work on Windows?
This version does not have a save to pdf option?
v.1.06 (2019-01-31)

Author:  CELTIC88 [ Sat Feb 02, 2019 7:41 pm ]
Post subject:  Re: VecVi - Create and output documents using VectorDrawing

very good project, thank you for sharing :D
 

Author:  Andesdaf [ Sat Feb 02, 2019 8:21 pm ]
Post subject:  Re: VecVi - Create and output documents using VectorDrawing

skywalk wrote:
Not sure why pdf would not work on Windows?


I use PB's PdfVectorOutput() which is not supported on Windows. On Linux and MacOS,
you can use VecVi::OutputPDF(). For PDF output on Windows, there is the fork with
PurePDF usage mentioned in my previous post.

Author:  Andesdaf [ Fri Jul 24, 2020 5:21 pm ]
Post subject:  Re: VecVi - Create and output documents using VectorDrawing

Updated to v.1.10, mainly for improving the performance of the print preview with larger data.
Now only the elements that need to be displayed will be calculated before. In addition some
minor improvements, clarifications and bugfixes.

Code:
;   v.1.10 (2020-07-24)
;    - completely reworked processing and drawing engine
;    - added Process()
;    - added GetBackColor() / SetBackColor()
;    - added reset possibility to SetFillColor(), SetTextColor(),
;      SetLineColor(), SetLineStyle()
;    - renamed *Page*() commands to *Section*() for clarification
;    - renamed GetRealPageCount() to GetPageCount()
;    - renamed GetRealPageStartOffset() to GetPageStartOffset()
;    - renamed *SinglePageOutput() commands to *MultiPageOutput()
;    - fixed bug in GetLineStyle()
;    - fixed various bugs in processing and drawing engine
;    - drawing of bigger documents is now much faster


Versions with PurePDF and pbPDF implementation (on Windows without PDF support) also available
https://raw.githubusercontent.com/hgzh/ ... PurePDF.pb
https://raw.githubusercontent.com/hgzh/ ... i_pbPDF.pb

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/