summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorL Peter Deutsch <lpd@ghostscript.com>2002-04-12 19:34:15 +0000
committerL Peter Deutsch <lpd@ghostscript.com>2002-04-12 19:34:15 +0000
commit6a4c7edf563ae36713c66818a06177a9ad3e1a7e (patch)
tree01c97066e269253104b7a0a55287576a3a68894c
parent6e7d9c7e166ab6eff1c1a7ffbaefc219de14fe79 (diff)
downloadghostpdl-6a4c7edf563ae36713c66818a06177a9ad3e1a7e.tar.gz
Removes all tests for pdfwrite CompatibilityLevel < 1.2, since these are
always false: the lowest supported PDF output level has been 1.2 for quite a long time. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@2484 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/src/gdevpdfb.c4
-rw-r--r--gs/src/gdevpdfe.c16
-rw-r--r--gs/src/gdevpdfg.c68
-rw-r--r--gs/src/gdevpdfi.c27
-rw-r--r--gs/src/gdevpdfm.c4
-rw-r--r--gs/src/gdevpdfu.c5
-rw-r--r--gs/src/gdevpdfw.c10
7 files changed, 51 insertions, 83 deletions
diff --git a/gs/src/gdevpdfb.c b/gs/src/gdevpdfb.c
index 43bd00ab7..a8db883ab 100644
--- a/gs/src/gdevpdfb.c
+++ b/gs/src/gdevpdfb.c
@@ -478,9 +478,7 @@ gdev_pdf_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles,
if (tiles->id == gx_no_bitmap_id || tiles->shift != 0 ||
(w < tw && h < th) ||
- color0 != gx_no_color_index ||
- /* Pattern fills are only available starting in PDF 1.2. */
- pdev->CompatibilityLevel < 1.2
+ color0 != gx_no_color_index
)
goto use_default;
if (color1 != gx_no_color_index) {
diff --git a/gs/src/gdevpdfe.c b/gs/src/gdevpdfe.c
index 219ee61d4..29a7426ab 100644
--- a/gs/src/gdevpdfe.c
+++ b/gs/src/gdevpdfe.c
@@ -214,10 +214,11 @@ pdf_embed_font_type1(gx_device_pdf *pdev, gs_font_type1 *font,
{
switch (((const gs_font *)font)->FontType) {
case ft_encrypted:
- if (pdev->CompatibilityLevel < 1.2)
- return pdf_embed_font_as_type1(pdev, font, FontFile_id,
- subset_glyphs, subset_size, pfname);
- /* For PDF 1.2 and later, write Type 1 fonts as Type1C. */
+ /*
+ * Since we only support PDF 1.2 and later, always write Type 1
+ * fonts as Type1C.
+ */
+ /* falls through */
case ft_encrypted2:
return pdf_embed_font_as_type2(pdev, font, FontFile_id,
subset_glyphs, subset_size, pfname);
@@ -232,13 +233,10 @@ pdf_embed_font_cid0(gx_device_pdf *pdev, gs_font_cid0 *font,
long FontFile_id, const byte *subset_cids,
uint subset_size, const gs_const_string *pfname)
{
- int code;
pdf_data_writer_t writer;
+ int code = pdf_begin_fontfile(pdev, FontFile_id, "/Subtype/CIDFontType0C",
+ -1L, &writer);
- if (pdev->CompatibilityLevel < 1.2)
- return_error(gs_error_rangecheck);
- code = pdf_begin_fontfile(pdev, FontFile_id, "/Subtype/CIDFontType0C", -1L,
- &writer);
if (code < 0)
return code;
code = psf_write_cid0_font(writer.binary.strm, font, TYPE2_OPTIONS,
diff --git a/gs/src/gdevpdfg.c b/gs/src/gdevpdfg.c
index 8e38079db..c6e11d95a 100644
--- a/gs/src/gdevpdfg.c
+++ b/gs/src/gdevpdfg.c
@@ -902,7 +902,7 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_imager_state *pis,
* removal, halftone phase, overprint mode, smoothness, blend mode, text
* knockout.
*/
- if (pdev->CompatibilityLevel >= 1.2) {
+ {
gs_int_point phase, dev_phase;
char hts[5 + MAX_FN_CHARS + 1],
trs[5 + MAX_FN_CHARS * 4 + 6 + 1],
@@ -996,22 +996,20 @@ pdf_prepare_fill(gx_device_pdf *pdev, const gs_imager_state *pis)
if (code < 0)
return code;
/* Update overprint. */
- if (pdev->CompatibilityLevel >= 1.2) {
- if (pdev->params.PreserveOverprintSettings &&
- pdev->fill_overprint != pis->overprint
- ) {
- code = pdf_open_gstate(pdev, &pres);
- if (code < 0)
- return code;
- /* PDF 1.2 only has a single overprint setting. */
- if (pdev->CompatibilityLevel < 1.3) {
- pprintb1(pdev->strm, "/OP %s", pis->overprint);
- pdev->stroke_overprint = pis->overprint;
- } else {
- pprintb1(pdev->strm, "/op %s", pis->overprint);
- }
- pdev->fill_overprint = pis->overprint;
+ if (pdev->params.PreserveOverprintSettings &&
+ pdev->fill_overprint != pis->overprint
+ ) {
+ code = pdf_open_gstate(pdev, &pres);
+ if (code < 0)
+ return code;
+ /* PDF 1.2 only has a single overprint setting. */
+ if (pdev->CompatibilityLevel < 1.3) {
+ pprintb1(pdev->strm, "/OP %s", pis->overprint);
+ pdev->stroke_overprint = pis->overprint;
+ } else {
+ pprintb1(pdev->strm, "/op %s", pis->overprint);
}
+ pdev->fill_overprint = pis->overprint;
}
return pdf_end_gstate(pdev, pres);
}
@@ -1026,26 +1024,24 @@ pdf_prepare_stroke(gx_device_pdf *pdev, const gs_imager_state *pis)
if (code < 0)
return code;
/* Update overprint, stroke adjustment. */
- if (pdev->CompatibilityLevel >= 1.2) {
- if (pdev->params.PreserveOverprintSettings &&
- pdev->stroke_overprint != pis->overprint
- ) {
- code = pdf_open_gstate(pdev, &pres);
- if (code < 0)
- return code;
- pprintb1(pdev->strm, "/OP %s", pis->overprint);
- pdev->stroke_overprint = pis->overprint;
- /* PDF 1.2 only has a single overprint setting. */
- if (pdev->CompatibilityLevel < 1.3)
- pdev->fill_overprint = pis->overprint;
- }
- if (pdev->state.stroke_adjust != pis->stroke_adjust) {
- code = pdf_open_gstate(pdev, &pres);
- if (code < 0)
- return code;
- pprintb1(pdev->strm, "/SA %s", pis->stroke_adjust);
- pdev->state.stroke_adjust = pis->stroke_adjust;
- }
+ if (pdev->params.PreserveOverprintSettings &&
+ pdev->stroke_overprint != pis->overprint
+ ) {
+ code = pdf_open_gstate(pdev, &pres);
+ if (code < 0)
+ return code;
+ pprintb1(pdev->strm, "/OP %s", pis->overprint);
+ pdev->stroke_overprint = pis->overprint;
+ /* PDF 1.2 only has a single overprint setting. */
+ if (pdev->CompatibilityLevel < 1.3)
+ pdev->fill_overprint = pis->overprint;
+ }
+ if (pdev->state.stroke_adjust != pis->stroke_adjust) {
+ code = pdf_open_gstate(pdev, &pres);
+ if (code < 0)
+ return code;
+ pprintb1(pdev->strm, "/SA %s", pis->stroke_adjust);
+ pdev->state.stroke_adjust = pis->stroke_adjust;
}
return pdf_end_gstate(pdev, pres);
}
diff --git a/gs/src/gdevpdfi.c b/gs/src/gdevpdfi.c
index bc6b51b6d..945345ec8 100644
--- a/gs/src/gdevpdfi.c
+++ b/gs/src/gdevpdfi.c
@@ -82,34 +82,13 @@ private RELOC_PTRS_WITH(pdf_image_enum_reloc_ptrs, pdf_image_enum *pie)
RELOC_PTRS_END
/*
- * Test whether we can write an image in-line. Before PDF 1.2, this is only
- * allowed for masks, images in built-in color spaces, and images in Indexed
- * color spaces based on these with a string lookup table.
+ * Test whether we can write an image in-line. This is always true,
+ * because we only support PDF 1.2 and later.
*/
private bool
can_write_image_in_line(const gx_device_pdf *pdev, const gs_image_t *pim)
{
- const gs_color_space *pcs;
-
- if (pim->ImageMask)
- return true;
- if (pdev->CompatibilityLevel >= 1.2)
- return true;
- pcs = pim->ColorSpace;
- cs:
- switch (gs_color_space_get_index(pcs)) {
- case gs_color_space_index_DeviceGray:
- case gs_color_space_index_DeviceRGB:
- case gs_color_space_index_DeviceCMYK:
- return true;
- case gs_color_space_index_Indexed:
- if (pcs->params.indexed.use_proc)
- return false;
- pcs = (const gs_color_space *)&pcs->params.indexed.base_space;
- goto cs;
- default:
- return false;
- }
+ return true;
}
/*
diff --git a/gs/src/gdevpdfm.c b/gs/src/gdevpdfm.c
index 277e3963c..b5c320dbc 100644
--- a/gs/src/gdevpdfm.c
+++ b/gs/src/gdevpdfm.c
@@ -1003,9 +1003,7 @@ pdfmark_PS(gx_device_pdf * pdev, gs_param_string * pairs, uint count,
!ps_source_ok(&level1))
)
return_error(gs_error_rangecheck);
- if (level1.data == 0 && source.size <= MAX_PS_INLINE &&
- pdev->CompatibilityLevel >= 1.2 && objname == 0
- ) {
+ if (level1.data == 0 && source.size <= MAX_PS_INLINE && objname == 0) {
/* Insert the PostScript code in-line */
int code = pdf_open_contents(pdev, PDF_IN_STREAM);
stream *s;
diff --git a/gs/src/gdevpdfu.c b/gs/src/gdevpdfu.c
index abffea10c..f3d6835ec 100644
--- a/gs/src/gdevpdfu.c
+++ b/gs/src/gdevpdfu.c
@@ -922,7 +922,7 @@ pdf_begin_data_stream(gx_device_pdf *pdev, pdf_data_writer_t *pdw,
int filters = 0;
int code;
- if (pdev->CompatibilityLevel >= 1.2 && (options & DATA_STREAM_COMPRESS)) {
+ if (options & DATA_STREAM_COMPRESS) {
filters |= USE_FLATE;
options |= DATA_STREAM_BINARY;
}
@@ -990,8 +990,7 @@ pdf_function(gx_device_pdf *pdev, const gs_function_t *pfn,
return_error(gs_error_VMerror);
pdev->strm = s;
code = psdf_begin_binary((gx_device_psdf *)pdev, &writer);
- if (code >= 0 && info.data_size > 30 && /* 30 is arbitrary */
- pdev->CompatibilityLevel >= 1.2
+ if (code >= 0 && info.data_size > 30 /* 30 is arbitrary */
)
code = pdf_flate_binary(pdev, &writer);
if (code >= 0) {
diff --git a/gs/src/gdevpdfw.c b/gs/src/gdevpdfw.c
index 4f89bc4f1..c3da4fb38 100644
--- a/gs/src/gdevpdfw.c
+++ b/gs/src/gdevpdfw.c
@@ -259,11 +259,11 @@ pdf_write_FontDescriptor(gx_device_pdf *pdev, const pdf_font_descriptor_t *pfd)
code = gs_note_error(gs_error_rangecheck);
/* falls through */
case ft_encrypted:
- if (pdev->CompatibilityLevel < 1.2) {
- FontFile_key = "/FontFile";
- break;
- }
- /* For PDF 1.2 and later, write Type 1 fonts as Type1C. */
+ /*
+ * Since we only support PDF 1.2 and later, always write
+ * Type 1 fonts as Type1C.
+ */
+ /* falls through */
case ft_encrypted2:
case ft_CID_encrypted:
FontFile_key = "/FontFile3";