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
Was:Forum Upgrade? by @Re...
by
dbannon
[
Today
at 10:45:21 am]
LazCAD – First Release!
by
maurog
[
Today
at 10:37:12 am]
Browser User Agent & Frie...
by
MarkMLl
[
Today
at 10:29:33 am]
Font draw in customdraw i...
by
mikutu
[
Today
at 10:28:00 am]
[Solved] Unable install l...
by
dsiders
[
Today
at 10:27:32 am]
[Solved] PATCH method in ...
by
JohnnieK
[
Today
at 09:13:00 am]
Forum is so SLOOOW... Aga...
by
Gustavo 'Gus' Carreno
[
Today
at 08:15:51 am]
Is there a "canonical" Gi...
by
dsiders
[
Today
at 08:04:09 am]
IDE odd behaviour
by
alpine
[
Today
at 07:38:13 am]
Terminal Component Availa...
by
JZS
[
Today
at 07:37:28 am]
CPU & Memory Profiler
by
AlexTP
[
Today
at 07:29:58 am]
Problem with pasting text...
by
paweld
[
Today
at 06:22:36 am]
Advice/Guidance Needed Wi...
by
dbannon
[
Today
at 06:07:33 am]
TStateMachine
by
avra
[
Today
at 12:44:55 am]
Lazarus IDE Windows 64 lo...
by
StuPot
[
Today
at 12:01:38 am]
My first Attempt making a...
by
jamie
[September 09, 2024, 11:43:32 pm]
Extended Module Player
by
Gigatron
[September 09, 2024, 09:11:48 pm]
How to disable the compat...
by
Jonas Maebe
[September 09, 2024, 08:59:30 pm]
How to create webhook in ...
by
Prakash
[September 09, 2024, 07:59:41 pm]
New Component jZCamView
by
Guser979
[September 09, 2024, 07:49:22 pm]
Forum upgrade?
by
MarkMLl
[September 09, 2024, 07:47:00 pm]
Is there a maximum length...
by
Remy Lebeau
[September 09, 2024, 07:35:30 pm]
THTTPRouter Documentation
by
JohnnieK
[September 09, 2024, 05:54:48 pm]
TryStrToFloat
by
jcmontherock
[September 09, 2024, 05:25:30 pm]
Having difficulty buidlin...
by
MarkMLl
[September 09, 2024, 03:49:23 pm]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: PostScript (page 01) for preview display via FPvectorial? (Read 18612 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