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
IRC channel
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
Forum slow
by
TRon
[
Today
at 01:16:26 am]
Demoscene The Champs Crac...
by
Gigatron
[
Today
at 01:05:16 am]
How to use the Event Log?
by
n7800
[
Today
at 12:47:25 am]
v3.99 code completion que...
by
440bx
[
Today
at 12:45:55 am]
FpDebug breakpoint on "be...
by
440bx
[
Today
at 12:36:23 am]
Generics - correct syntax
by
jamie
[
Today
at 12:09:16 am]
Access violation when re-...
by
TRon
[April 19, 2024, 11:44:51 pm]
[solved] how to get class...
by
jamie
[April 19, 2024, 11:34:44 pm]
Lazarus for Windows on aa...
by
Wallaby
[April 19, 2024, 10:52:25 pm]
Poll: Watches and Display...
by
440bx
[April 19, 2024, 07:13:51 pm]
InstallAware Using Lazaru...
by
marcov
[April 19, 2024, 04:46:46 pm]
Who is Indy mattias?
by
paweld
[April 19, 2024, 04:17:53 pm]
I just released a commerc...
by
BrassGear
[April 19, 2024, 03:17:28 pm]
Does anyone know why thes...
by
Laksen
[April 19, 2024, 03:04:14 pm]
Database standards OR Am ...
by
gidesa
[April 19, 2024, 02:37:56 pm]
How to: create DLL file f...
by
TRon
[April 19, 2024, 02:26:53 pm]
A fairly simple sound sol...
by
paweld
[April 19, 2024, 01:46:11 pm]
Access violation when ope...
by
Чебурашка
[April 19, 2024, 12:27:34 pm]
Step-into the field sette...
by
Martin_fr
[April 19, 2024, 11:31:48 am]
AI, NLP and CAI: Text Gen...
by
Dzandaa
[April 19, 2024, 11:03:26 am]
dwindows for Android
by
PierceNg
[April 19, 2024, 10:54:44 am]
create system unit from s...
by
Laksen
[April 19, 2024, 10:53:57 am]
[Solved] Find child contr...
by
Joanna
[April 19, 2024, 09:53:43 am]
FpDebug unexpected Assemb...
by
Marc
[April 19, 2024, 08:46:38 am]
Offical launch of the 1 B...
by
Handoko
[April 19, 2024, 07:59:07 am]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: PostScript (page 01) for preview display via FPvectorial? (Read 17962 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