🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.postscript.programming
16 messages
16 total messages Started by Jorge_Pease Thu, 01 Jul 2004 15:43
selective extract of pages and convert to tiff or pdf for web view
#467
Author: Jorge_Pease
Date: Thu, 01 Jul 2004 15:43
9 lines
1484 bytes
We currently compose and print variable data transactional files. Our print file is a post script file created by Group1's DOC1 composition software.

Group1 now owned by Pitney Bowes also offers a software that works in conjunction with a journal file to selectively extract x pages and convert them to an image or pdf for web view. This software unfortunately is not economically an option for us.

In their post composition software which we use, we select pages based on a vector variable that we aquire in a journal file when we create the postscript file.

I am wondering how we can simulate this ourselves using something like PHP or.... so we can archive the postscript file and select extract and serve pages to authorized users.

Has anybody had to deal with this.
Re: selective extract of pages and convert to tiff or pdf for web view
#468
Author: Helge_Blischke
Date: Thu, 01 Jul 2004 16:25
1 lines
798 bytes
Please post an URL to a sample file.. I think I ccan give you some hints how to do what you intend.
Re: selective extract of pages and convert to tiff or pdf for web view
#471
Author: tgreer
Date: Thu, 01 Jul 2004 19:12
4 lines
815 bytes
activePDF server is a COM-object that will process PostScript files to PDF.

Thomas D. Greer
 <http://www.tgreer.com>
Re: selective extract of pages and convert to tiff or pdf for web view
#470
Author: Jorge_Pease
Date: Thu, 01 Jul 2004 19:18
11 lines
1171 bytes
Helge,

here is the url

 <http://www.arrowmail.org/test/tryme.zip>

This is a sample file provided by group1. It represents the type of file we would be creating. The files would be large 20,000 documents and up and each document would be comprised of variable pages.

At the time of creating the postscript file we can create a journal as I stated before to create an index. When a user logs on we want to use the index to read from the postscript file the document that pertains to that specific user.

Thanks for any ideas
Re: selective extract of pages and convert to tiff or pdf for web view
#472
Author: Jorge_Pease
Date: Thu, 01 Jul 2004 19:27
7 lines
976 bytes
Hi,

We need to be able to read only x number of pages from the postscript file. Those pages would comprise a complete document, such as say a telephone bill.

How would activePDF server handle that? I am reading on it now but I do not see any examples of this.

Thanks
Re: selective extract of pages and convert to tiff or pdf for web view
#473
Author: tgreer
Date: Thu, 01 Jul 2004 20:05
4 lines
843 bytes
I misunderstood your question. I thought you already had the ability to extract pages from the PostScript source, and just wanted to interpret/render them to PDF.

Thomas D. Greer
 <http://www.tgreer.com>
Re: selective extract of pages and convert to tiff or pdf for web view
#474
Author: Aandi_Inston
Date: Thu, 01 Jul 2004 20:12
3 lines
849 bytes
Are the files DSC compliant?  

Aandi Inston
Re: selective extract of pages and convert to tiff or pdf for web view
#475
Author: Jorge_Pease
Date: Thu, 01 Jul 2004 20:44
5 lines
1032 bytes
The files are supposedly DSC compliant. Doc1 provides some capability to insert dsc commands for selecting paper tray etc...

I have yet to get this to work but am still working on it. Since they could not get it to work in the class I attended, I am not too hopefull.

I can also output pdf's though I am not too keen on storing thousands of pdf's.
Re: selective extract of pages and convert to tiff or pdf for web view
#477
Author: Aandi_Inston
Date: Fri, 02 Jul 2004 07:58
33 lines
2055 bytes
If a PostScript file really is DSC compliant, extracting pages is a
fairly simple mechanical process. For instance, the information that
marks page 431 should follow a line

%%Page: 431 431

and run to %%EndPage or the next %%Page: line. It's not quite a simple
as that might suggest, but it is at least doable - without DSC it may
not be possible at all.

I have heard of a tool psselect that supposedly can extract pages from
a DSC compliant file and save it as a new valid file.

(Why may it be impossible?  Consider this code

/pagenumber 1 def
10  % repeat count
{
  /Helvetica 20 selectfont 72 500 moveto % prepare to show text
  pagenumber 10 string cvi % convert pagenumber to string
  show % write page number
  showpage % finish page
  /pagenumber pagenumber 1 add def  % increase pagenumber
}
repeat

This page writes 10 pages, each with a number. Clearly, you cannot use
any simple "cut here" logic to extract page 3. That's not to say the
task cannot be done; typically the entire file would be converted to
PDF, then PDF pages extracted, and finally a new PostScript file
written)

Aandi Inston
Re: selective extract of pages and convert to tiff or pdf for web view
#478
Author: Helge_Blischke
Date: Fri, 02 Jul 2004 13:32
28 lines
1472 bytes
Jorge,

the file is DSC compliant. For every group of consecutive pages you
are going to extract, paste the following together:

1. From the beginning of the PS file up to and including the line
%%EndSetup


2. From the line
%%Page: n n
(n n the page count numbers) of the first page to select
up to but excluding the %%Page: comment line of the first
page not to include

3. From the line
%%Trailer
up to the end of the PS file.

This task may be done by any scripting language you are aquainted to;
only make sure that you indices point to the proper file positions.

Remark:
There is one minor bug in the setup section of the PS file:
there is a definefont statement that leaves the fond dictionary
on the operand stack.

Helge
Re: selective extract of pages and convert to tiff or pdf for web view
#479
Author: Jorge_Pease
Date: Fri, 02 Jul 2004 15:47
9 lines
956 bytes
Helge,

Thanks for the example. I think creating the index should be pretty cut and dry. The bug you speak of, how minor is it and is there a workaround?

Aandi,

I looked at psselect. It looks like what we want though I only know web scripting. Not sure how I would run the program with the query.

Thanks
Re: selective extract of pages and convert to tiff or pdf for web view
#480
Author: Aandi_Inston
Date: Fri, 02 Jul 2004 18:34
4 lines
954 bytes
I think you are going to have to go well beyond web scripting if you
want to provide some of the features you've described...

Aandi Inston
Re: selective extract of pages and convert to tiff or pdf for web view
#482
Author: Jorge_Pease
Date: Fri, 02 Jul 2004 21:13
9 lines
1161 bytes
Your probably right. At least I can extract the pages and create my new PS file with PHP. The index is not a problem. I don't know what the minor bug is about, have to get some more feedback on that.

The conversion I was thinking of using the image magick library. Though it may end up that we find a ready to go software or get somebody that specializes in this.

If I do have to do it, I think it would be doable with PHP using ImageMagick and ghostscript.

Thanks.

JP
Re: selective extract of pages and convert to tiff or pdf for web view
#483
Author: Helge_Blischke
Date: Sat, 03 Jul 2004 13:36
3 lines
948 bytes
Jorge,

the "minor bug" is harmless as long as the PS interpreter (or whatever appliacation interpretes the selected PS job) terminates thereafter.
Re: selective extract of pages and convert to tiff or pdf for web view
#485
Author: Jorge_Pease
Date: Sat, 03 Jul 2004 14:13
9 lines
1095 bytes
Ok, Thanks.

I have somebody to help me do the conversion to pdf. Was just wondering if anyone offhand knows a way to advance the pointer to read from a specific offset other than
to read up to that offset in the first place.

I can preconstruct the header and footer since these will be template files.
This would make the extraction process pretty simple if I could read AT the specified offset.

Thanks.
Re: selective extract of pages and convert to tiff or pdf for web view
#486
Author: Jorge_Pease
Date: Sat, 03 Jul 2004 22:48
5 lines
829 bytes
Never mind, got it.

PHP provides fseek function for doing this. Yep it looks like this can all be done in PHP fairly easily.

Thanks for your help.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads