Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
FPvectorial
»
PostScript (page 01) for preview display via FPvectorial?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
PostgreSQL "no route to h...
by
wcage03
[
Today
at 10:48:04 pm]
TControlBar and hence the...
by
paule32
[
Today
at 10:20:25 pm]
How to Build Laz IDE from...
by
Barberr
[
Today
at 10:08:20 pm]
NIL vs. Assign: when to u...
by
Remy Lebeau
[
Today
at 09:48:31 pm]
PScript or MagicScript ad...
by
eldonfsr
[
Today
at 09:44:53 pm]
Hooking to `OnISupport` d...
by
Remy Lebeau
[
Today
at 09:42:20 pm]
Connection to MySQL versi...
by
iginfo
[
Today
at 09:40:52 pm]
Converting a Project from...
by
cdbc
[
Today
at 08:32:07 pm]
Hustle - A simple task ma...
by
Hansvb
[
Today
at 07:42:04 pm]
Bindings for PlutoVG
by
CynicRus
[
Today
at 07:09:50 pm]
efficiency problem
by
LV
[
Today
at 07:00:15 pm]
zeosdb zupdate don't work...
by
eldonfsr
[
Today
at 06:11:23 pm]
IfThenStr does not work -...
by
Thaddy
[
Today
at 04:43:13 pm]
[Solved] Exception "In Ha...
by
cdbc
[
Today
at 04:34:14 pm]
File IO issues
by
dryzone
[
Today
at 03:58:23 pm]
savescreen, restscrren
by
k1attila1
[
Today
at 03:52:29 pm]
How to make RunCommand NO...
by
zxandris
[
Today
at 03:17:07 pm]
[maybe SOLVED] BUG in Inp...
by
robert rozee
[
Today
at 03:03:10 pm]
Different builds for more...
by
daniel_sap
[
Today
at 02:54:57 pm]
Website renovation
by
Aruna
[
Today
at 02:51:59 pm]
Error after installing ne...
by
sbulazel
[
Today
at 02:28:16 pm]
[Solved] Illegal expressi...
by
nikel
[
Today
at 12:56:23 pm]
How to compile project fr...
by
MarkMLl
[
Today
at 11:43:42 am]
FPC 2.2.2 for classic Mac...
by
Jonas Maebe
[
Today
at 11:13:17 am]
R3D - 3D Rendering Librar...
by
axel18
[
Today
at 11:01:59 am]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: PostScript (page 01) for preview display via FPvectorial? (Read 19479 times)
Blestan
Sr. Member
Posts: 461
Re: PostScript (page 01) for preview display via FPvectorial?
«
Reply #15 on:
August 05, 2017, 03:40:53 pm »
the api has run string to ezexute ps code but i think that max buffer size is 64K ... as i told ps is extremely expensive complex and slow to run and render
Logged
Speak postscript or die!
Translate to pdf and live!
PaulANormanNZ
Full Member
Posts: 117
Re: PostScript (page 01) for preview display via FPvectorial?
«
Reply #16 on:
August 06, 2017, 03:45:26 am »
Thanks Blestan,
Getting a preview onto a Lazarus canvas is my focus - but how much time would really be saved trying for a more internal Lazarus path, when the main time overhead from what everyone is saying: is the GS processing portion - so writing bmp/jpeg/png to disk and reading the 'preview' back from disk may not be the time overhang I have envisaged and been trying to avoid?
Doing it all from GS DLL should nonetheless be faster than a Shell call; I can assume?
In the background stuff below, there is a test.exe pilot (incomplete) project that appears to actually render a workable preview of a .ps file in Delphi (found in gsapi_delphi.zip)..
Written by Alessandro Briosi with the
// assistance of Russell Lang it all uses a unit gsimage providing TGsImage which gives us:
DISPLAY_COLORS_GRAY, _RGB, _CMYK
and Colour depths 1, 4, 8, 16
Offers varying DPI and is quite fast already actually. Looking hopeful.
I think its all under an MIT like license, so this may save some time?
---
Found some background stuff in case it saves any one any time...
The Delphi community have some helpful things--
https://stackoverflow.com/questions/20778134/extracting-plain-text-from-postscript-file-via-gsdll32-dll
The Answer there -
GhostTools.pas Class file for GSDLL32.DLL
has some helpful top level things.
It uses gsapi.pas no longer available via
http://pages.cs.wisc.edu/~ghost/doc/gsapi.htm
and
http://mirror.cs.wisc.edu/pub/mirrors/ghost/contrib/gsapi_delphi.zip
gsapi.pas is findable here though:
http://www.filewatcher.com/m/gsapi_delphi.zip.208923-0.html
And from that bundle specifically this looks helpful:
https://github.com/tristan2468/PDFPrint/blob/master/GhostScript.pas
Some notes here:
http://mseide-msegui-talk.narkive.com/2UJ4ZIAh/ghostscript-api-implementation
Paul
«
Last Edit: August 06, 2017, 04:21:12 am by PaulANormanNZ
»
Logged
PaulANormanNZ
Full Member
Posts: 117
Re: PostScript (page 01) for preview display via FPvectorial?
«
Reply #17 on:
August 06, 2017, 08:05:37 am »
Ok,
I imported that trial test.dpr into Lazarus from gsapi_delphi.zip
After the import I only had to REM line 192 in gsimage.pas
// was needed ...
// bm.IgnorePalette:=true;
... I'm not sure whether this needs further research or things are ok as they are now.
Any way it works very well as it is so far.
Certainly adequate for a generalised preview glimpse of PS. Handles pagination and all.
I've attached gasp_delphi.zip there is a readme.txt
Paul
Logged
Blestan
Sr. Member
Posts: 461
Re: PostScript (page 01) for preview display via FPvectorial?
«
Reply #18 on:
August 06, 2017, 08:32:04 am »
good to see that you are advancing !!!
just few more hints from me:
1. try to use as canvas bgrabitap because its very very... as i did for mupdf. it will save alot of drawing time
2. if you want adecuate colors of the preview use litlecms... pascal bindings are perfect.
3. if you render/ saving to a temp file avoid using compressed files like jpg or png this will save alot of decoding time.
4. create please a github repo with all code name it fpc-gs for example i will join
5. create a new theread in the forum under "graphics" section to anounce all gs stuff with others
blestan
Logged
Speak postscript or die!
Translate to pdf and live!
PaulANormanNZ
Full Member
Posts: 117
Re: PostScript (page 01) for preview display via FPvectorial?
«
Reply #19 on:
August 06, 2017, 10:56:33 am »
Thank you for the suggestions blestan, but I don't believe I have the competency to head up a component development for widespread usage.
May whoever is, and who is willing -please feel free to.
Certainly your experience with mupdf would be a really great basis to work from blestan!
Paul
Logged
Print
Pages:
1
[
2
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
FPvectorial
»
PostScript (page 01) for preview display via FPvectorial?
TinyPortal
© 2005-2018