summaryrefslogtreecommitdiff
path: root/gs/base/gdevpdfo.h
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2010-12-10 13:26:11 +0000
committerKen Sharp <ken.sharp@artifex.com>2010-12-10 13:26:11 +0000
commit1e16f0d019ddfcc60bab67650725b7eaf73fdc6a (patch)
treea672a0c3cb049f595da232aae3460e5a1796f319 /gs/base/gdevpdfo.h
parentac3dd5e1a390f2f53de4ad3269c78fbeabbc5a90 (diff)
pdfwrite enhancement : More work towards DSC compliance
This is a resubmission of revision 11941, with some additional changes so that it doesn't crash with pdfwrite on Linux systems. We now pass around the 'type' of an object much more when writing. This is so that we can emit "%%BeginResource/%%EndResource" comment pairs around the resources we write. It is also required so that we *don't* write these comments around pages. The code now emits %%BeginProlog, then writes the opdfread.ps procedure. It then writes all the various resources used in the document, each with a reasonable DSC comment. Then it writes %%EndProlog. After this come the page descriptions, each is written with a %%Page: comment and a %%PageTrailer. Finally we write the %%Trailer, %%Pages comment (NB we write %%Pages: (atend) in the header comments as we don't know how many pages there will be until the end) and %%EOF. The resources are mostly defined as being of type 'file', as most of them are not normal PostScript resources. The DSC specification says under the %%BeginResource definition (file note on p72) "The enclosed segment is a fragment of PostScript language code or some other item that does not fall within the other resource categories" and so this seems the best type to use for our purposes. The output is now minimally DSC compliant, though there are a few other comments I'd like to add if possible. Given the way the file is created we are always going to have a large prolog, and that will need to be copied to all the pages if they are split individually, in order to make sure that all the required resources are present. Technically we could follow the resource chain and write %%IncludeResource comments, at the page level at least, but this is probably more effort than it is realistically worth. Still need to add some more DSC comment types, and run some extensive testing. No differences expected currently. Minimal testing with GSView suggests that the output so far is DSC-compliant as-is. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11946 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/base/gdevpdfo.h')
-rw-r--r--gs/base/gdevpdfo.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gs/base/gdevpdfo.h b/gs/base/gdevpdfo.h
index 362f96455..8baaca921 100644
--- a/gs/base/gdevpdfo.h
+++ b/gs/base/gdevpdfo.h
@@ -323,8 +323,8 @@ int cos_dict_objects_write(const cos_dict_t *, gx_device_pdf *);
int cos_dict_objects_delete(cos_dict_t *);
/* Write a cos object as a PDF object. */
-int cos_write_object(cos_object_t *pco, gx_device_pdf *pdev);
-#define COS_WRITE_OBJECT(pc, pdev) cos_write_object(COS_OBJECT(pc), pdev)
+int cos_write_object(cos_object_t *pco, gx_device_pdf *pdev, pdf_resource_type_t type);
+#define COS_WRITE_OBJECT(pc, pdev, type) cos_write_object(COS_OBJECT(pc), pdev, type)
/* Free a Cos value owned by a Cos object. */
void cos_value_free(const cos_value_t *, const cos_object_t *, client_name_t);