"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "htmldoc/ps-pdf.cxx" between
htmldoc-1.9.11-source.tar.gz and htmldoc-1.9.12-source.tar.gz

About: HTMLDOC converts HTML and Markdown source files into indexed HTML, EPUB, PostScript, or PDF files (but doesn’t support CSS).

ps-pdf.cxx  (htmldoc-1.9.11-source):ps-pdf.cxx  (htmldoc-1.9.12-source)
/* /*
* PostScript + PDF output routines for HTMLDOC, a HTML document processing * PostScript + PDF output routines for HTMLDOC, a HTML document processing
* program. * program.
* *
* Just in case you didn't notice it, this file is too big; it will be * Just in case you didn't notice it, this file is too big; it will be
* broken into more manageable pieces once we make all of the output * broken into more manageable pieces once we make all of the output
* "drivers" into classes... * "drivers" into classes...
* *
* Copyright © 2011-2020 by Michael R Sweet. * Copyright © 2011-2021 by Michael R Sweet.
* Copyright © 1997-2010 by Easy Software Products. All rights reserved. * Copyright © 1997-2010 by Easy Software Products. All rights reserved.
* *
* This program is free software. Distribution and use rights are outlined in * This program is free software. Distribution and use rights are outlined in
* the file "COPYING". * the file "COPYING".
*/ */
/* /*
* Include necessary headers. * Include necessary headers.
*/ */
skipping to change at line 1305 skipping to change at line 1305
c = 1; c = 1;
for (; c <= TocDocCount; c ++) for (; c <= TocDocCount; c ++)
{ {
if (chapter_starts[c] < 0) if (chapter_starts[c] < 0)
continue; continue;
chapter_outstarts[c] = num_outpages; chapter_outstarts[c] = num_outpages;
for (i = chapter_starts[c], j = 0, nup = -1, page = pages + i; for (i = chapter_starts[c], j = 0, nup = -1, page = pages + i;
i <= chapter_ends[c]; i <= chapter_ends[c] && num_outpages < num_pages;
i ++, page ++) i ++, page ++)
{ {
if (nup != page->nup) if (nup != page->nup)
{ {
if (j) if (j)
{ {
// Break the current output page... // Break the current output page...
outpage ++; outpage ++;
num_outpages ++; num_outpages ++;
} }
skipping to change at line 1389 skipping to change at line 1389
*/ */
static void static void
pspdf_prepare_page(int page) /* I - Page number */ pspdf_prepare_page(int page) /* I - Page number */
{ {
int print_page; /* Printed page # */ int print_page; /* Printed page # */
char page_text[64]; /* Page number text */ char page_text[64]; /* Page number text */
int top; /* Top of page */ int top; /* Top of page */
DEBUG_printf(("pspdf_prepare_page(%d)\n", page)); DEBUG_printf(("pspdf_prepare_page(%d)\n", page));
if (page < 0 || (size_t)page >= num_pages)
return;
/* /*
* Make a page number; use roman numerals for the table of contents * Make a page number; use roman numerals for the table of contents
* and arabic numbers for all others... * and arabic numbers for all others...
*/ */
if (chapter == 0 && OutputType == OUTPUT_BOOK) if (chapter == 0 && OutputType == OUTPUT_BOOK)
{ {
print_page = page - chapter_starts[0] + 1; print_page = page - chapter_starts[0] + 1;
strlcpy(page_text, format_number(print_page, 'i'), sizeof(page_text)); strlcpy(page_text, format_number(print_page, 'i'), sizeof(page_text));
skipping to change at line 3561 skipping to change at line 3563
height, height,
rgb[3]; rgb[3];
int hpage; int hpage;
uchar number[1024], uchar number[1024],
*nptr, *nptr,
*link; *link;
tree_t *flat, tree_t *flat,
*temp, *temp,
*next; *next;
render_t *r; render_t *r;
float dot_width = _htmlSizes[SIZE_P] * _htmlWidths[t->typeface] [t->style]['.'] * 0.001f; float dot_width;
DEBUG_printf(("render_contents(t=%p, left=%.1f, right=%.1f, bottom=%.1f, top=% .1f, y=%.1f, page=%d, heading=%d, chap=%p)\n", DEBUG_printf(("render_contents(t=%p, left=%.1f, right=%.1f, bottom=%.1f, top=% .1f, y=%.1f, page=%d, heading=%d, chap=%p)\n",
(void *)t, left, right, bottom, top, *y, *page, heading, (void * )chap)); (void *)t, left, right, bottom, top, *y, *page, heading, (void * )chap));
if (!t) if (!t)
return; return;
dot_width = _htmlSizes[SIZE_P] * _htmlWidths[t->typeface][t->style]['.'] * 0.0
01f;
/* /*
* Put the text... * Put the text...
*/ */
flat = flatten_tree(t->child->child); flat = flatten_tree(t->child->child);
for (height = 0.0, temp = flat; temp != NULL; temp = temp->next) for (height = 0.0, temp = flat; temp != NULL; temp = temp->next)
if (temp->height > height) if (temp->height > height)
height = temp->height; height = temp->height;
skipping to change at line 3844 skipping to change at line 3848
{ {
render_contents(t, left, right, bottom, top, y, page, render_contents(t, left, right, bottom, top, y, page,
*heading, chap); *heading, chap);
/* /*
* Update current headings for header/footer strings in TOC. * Update current headings for header/footer strings in TOC.
*/ */
check_pages(*page); check_pages(*page);
if (t->markup == MARKUP_B && if (t->markup == MARKUP_B && pages[*page].chapter == pages[*page - 1]
pages[*page].chapter == pages[*page - 1].chapter) .chapter)
{
pages[*page].chapter = htmlGetText(t->child->child); pages[*page].chapter = htmlGetText(t->child->child);
for (int i = *page + 1; i < num_pages; i ++)
pages[i].chapter = pages[*page].chapter;
}
if (pages[*page].heading == pages[*page - 1].heading) if (pages[*page].heading == pages[*page - 1].heading)
{
pages[*page].heading = htmlGetText(t->child->child); pages[*page].heading = htmlGetText(t->child->child);
for (int i = *page + 1; i < num_pages; i ++)
pages[i].heading = pages[*page].heading;
}
/* /*
* Next heading... * Next heading...
*/ */
(*heading) ++; (*heading) ++;
if (t->last_child->markup == MARKUP_UL) if (t->last_child->markup == MARKUP_UL)
parse_contents(t->last_child, left, right, bottom, top, y, parse_contents(t->last_child, left, right, bottom, top, y,
page, heading, chap); page, heading, chap);
} }
skipping to change at line 4529 skipping to change at line 4542
{ {
(*page) ++; (*page) ++;
*y = top; *y = top;
if (Verbosity) if (Verbosity)
progress_show("Formatting page %d", *page); progress_show("Formatting page %d", *page);
} }
check_pages(*page); check_pages(*page);
if (t->markup == MARKUP_H1 && !title_page) if (t->markup == MARKUP_H1 && !title_page)
{
pages[*page].chapter = htmlGetText(current_heading); pages[*page].chapter = htmlGetText(current_heading);
for (int i = *page + 1; i < num_pages; i ++)
pages[i].chapter = pages[*page].chapter;
}
if ((pages[*page].heading == NULL || t->markup == MARKUP_H1 || if ((pages[*page].heading == NULL || t->markup == MARKUP_H1 ||
(*page > 0 && pages[*page].heading == pages[*page - 1].heading)) && (*page > 0 && pages[*page].heading == pages[*page - 1].heading)) &&
!title_page) !title_page)
{ {
pages[*page].heading = htmlGetText(current_heading); pages[*page].heading = htmlGetText(current_heading);
pages[*page].headnode = current_heading; pages[*page].headnode = current_heading;
for (int i = *page + 1; i < num_pages; i ++)
{
pages[i].heading = pages[*page].heading;
pages[i].headnode = current_heading;
}
} }
if ((t->markup - MARKUP_H1) < TocLevels && !title_page) if ((t->markup - MARKUP_H1) < TocLevels && !title_page)
{ {
DEBUG_printf(("H%d: heading_pages[%d] = %d\n", t->markup - MARKUP_H1 + 1, DEBUG_printf(("H%d: heading_pages[%d] = %d\n", t->markup - MARKUP_H1 + 1,
(int)num_headings, *page - 1)); (int)num_headings, *page - 1));
// See if we need to resize the headings arrays... // See if we need to resize the headings arrays...
if (num_headings >= alloc_headings) if (num_headings >= alloc_headings)
{ {
skipping to change at line 4941 skipping to change at line 4965
prev = temp; prev = temp;
temp = temp->next; temp = temp->next;
temp_width += prev->width; temp_width += prev->width;
if ((temp_width >= format_width && prev->markup == MARKUP_IMG) || if ((temp_width >= format_width && prev->markup == MARKUP_IMG) ||
prev->markup == MARKUP_BR) prev->markup == MARKUP_BR)
{ {
break; break;
} }
else if (prev->markup == MARKUP_NONE) else if (prev->markup == MARKUP_NONE && *(prev->data))
{ {
int ch = prev->data[strlen((char *)prev->data) - 1]; int ch = prev->data[strlen((char *)prev->data) - 1];
if (_htmlUTF8) if (_htmlUTF8)
ch = _htmlUnicode[ch]; ch = _htmlUnicode[ch];
if (ch == 173) if (ch == 173)
break; break;
} }
} }
skipping to change at line 5661 skipping to change at line 5685
DEBUG_printf(("BEFORE row_y = %.1f, *y = %.1f, row_page = %d\n", DEBUG_printf(("BEFORE row_y = %.1f, *y = %.1f, row_page = %d\n",
row_y, *y, row_page)); row_y, *y, row_page));
for (col = 0, rowspan = 9999; col < table.num_cols; col += colspan) for (col = 0, rowspan = 9999; col < table.num_cols; col += colspan)
{ {
if (table.row_spans[col] == 0) if (table.row_spans[col] == 0)
{ {
if ((var = htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN")) != NULL) if ((var = htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN")) != NULL)
table.row_spans[col] = atoi((char *)var); table.row_spans[col] = atoi((char *)var);
if (table.row_spans[col] == 1) if (table.row_spans[col] <= 1)
table.row_spans[col] = 0; table.row_spans[col] = 0;
if (table.row_spans[col] > (table.num_rows - row)) if (table.row_spans[col] > (table.num_rows - row))
table.row_spans[col] = table.num_rows - row; table.row_spans[col] = table.num_rows - row;
table.span_heights[col] = 0.0f; table.span_heights[col] = 0.0f;
} }
if (table.row_spans[col] < rowspan) if (table.row_spans[col] < rowspan)
rowspan = table.row_spans[col]; rowspan = table.row_spans[col];
skipping to change at line 5984 skipping to change at line 6008
if (p == table.cell_end[col]) if (p == table.cell_end[col])
break; break;
} }
} }
#endif /* DEBUG */ #endif /* DEBUG */
} }
} }
// Update all current columns with ROWSPAN <= rowspan to use the same // Update all current columns with ROWSPAN <= rowspan to use the same
// end page and row... // end page and row...
for (col = 0, temp_page = -1, temp_y = 99999999; col < table.num_cols; col ++) for (col = 0, temp_page = -1, temp_y = 99999999.0f; col < table.num_cols; col ++)
if (table.row_spans[col] <= rowspan && if (table.row_spans[col] <= rowspan &&
cells[row][col] != NULL && cells[row][col]->child != NULL) cells[row][col] != NULL && cells[row][col]->child != NULL)
{ {
if (table.cell_endpage[col] > temp_page) if (table.cell_endpage[col] > temp_page)
{ {
temp_page = table.cell_endpage[col]; temp_page = table.cell_endpage[col];
temp_y = table.cell_endy[col]; temp_y = table.cell_endy[col];
} }
else if (table.cell_endpage[col] == temp_page && table.cell_endy[col] < te mp_y) else if (table.cell_endpage[col] == temp_page && table.cell_endy[col] < te mp_y)
temp_y = table.cell_endy[col]; temp_y = table.cell_endy[col];
skipping to change at line 6302 skipping to change at line 6326
*/ */
cells = NULL; cells = NULL;
if ((var = htmlGetVariable(t, (uchar *)"WIDTH")) != NULL) if ((var = htmlGetVariable(t, (uchar *)"WIDTH")) != NULL)
{ {
if (var[strlen((char *)var) - 1] == '%') if (var[strlen((char *)var) - 1] == '%')
table_width = (float)(atof((char *)var) * (right - left) / 100.0f); table_width = (float)(atof((char *)var) * (right - left) / 100.0f);
else else
table_width = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWid th); table_width = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWid th);
if (table_width < 0.0f || table_width > PagePrintWidth)
table_width = right - left;
} }
else else
table_width = right - left; table_width = right - left;
if ((var = htmlGetVariable(t, (uchar *)"HEIGHT")) != NULL) if ((var = htmlGetVariable(t, (uchar *)"HEIGHT")) != NULL)
{ {
if (var[strlen((char *)var) - 1] == '%') if (var[strlen((char *)var) - 1] == '%')
table.height = (float)(atof((char *)var) * (top - bottom) / 100.0f); table.height = (float)(atof((char *)var) * (top - bottom) / 100.0f);
else else
table.height = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWi dth); table.height = (float)(atoi((char *)var) * PagePrintWidth / _htmlBrowserWi dth);
} }
else else
table.height = -1.0f; table.height = -1.0f;
DEBUG_printf(("table_width = %.1f\n", table_width)); DEBUG_printf(("table_width = %.1f\n", table_width));
if ((var = htmlGetVariable(t, (uchar *)"CELLPADDING")) != NULL) if ((var = htmlGetVariable(t, (uchar *)"CELLPADDING")) != NULL)
table.cellpadding = atoi((char *)var); {
if ((table.cellpadding = atoi((char *)var)) < 0.0f)
table.cellpadding = 0.0f;
else if (table.cellpadding > 20.0f)
table.cellpadding = 20.0f;
}
else else
table.cellpadding = 1.0f; table.cellpadding = 1.0f;
if ((var = htmlGetVariable(t, (uchar *)"CELLSPACING")) != NULL) if ((var = htmlGetVariable(t, (uchar *)"CELLSPACING")) != NULL)
cellspacing = atoi((char *)var); {
if ((cellspacing = atoi((char *)var)) < 0.0f)
cellspacing = 0.0f;
else if (cellspacing > 20.0f)
cellspacing = 20.0f;
}
else else
cellspacing = 0.0f; cellspacing = 0.0f;
if ((var = htmlGetVariable(t, (uchar *)"BORDER")) != NULL) if ((var = htmlGetVariable(t, (uchar *)"BORDER")) != NULL)
{ {
if ((table.border = (float)atof((char *)var)) == 0.0 && var[0] != '0') if ((table.border = (float)atof((char *)var)) <= 0.0 && var[0] != '0')
table.border = 1.0f; table.border = 1.0f;
else if (table.border > 20.0f)
table.border = 20.0f;
table.cellpadding += table.border; table.cellpadding += table.border;
} }
else else
table.border = 0.0f; table.border = 0.0f;
if (table.debug && table.border == 0.0f) if (table.debug && table.border == 0.0f)
table.border = 0.01f; table.border = 0.01f;
table.border_rgb[0] = t->red / 255.0f; table.border_rgb[0] = t->red / 255.0f;
skipping to change at line 6361 skipping to change at line 6400
* Ah, the strange table formatting nightmare that is HTML. * Ah, the strange table formatting nightmare that is HTML.
* Netscape and MSIE assign an invisible border width of 1 * Netscape and MSIE assign an invisible border width of 1
* pixel if no border is specified... * pixel if no border is specified...
*/ */
table.cellpadding += 1.0f; table.cellpadding += 1.0f;
} }
table.border_size = table.border - 1.0f; table.border_size = table.border - 1.0f;
cellspacing *= PagePrintWidth / _htmlBrowserWidth; cellspacing *= PagePrintWidth / _htmlBrowserWidth;
table.cellpadding *= PagePrintWidth / _htmlBrowserWidth; table.cellpadding *= PagePrintWidth / _htmlBrowserWidth;
table.border *= PagePrintWidth / _htmlBrowserWidth; table.border *= PagePrintWidth / _htmlBrowserWidth;
table.border_size *= PagePrintWidth / _htmlBrowserWidth; table.border_size *= PagePrintWidth / _htmlBrowserWidth;
DEBUG_printf(("border = %.1f, cellpadding = %.1f\n", table.border, table.cellp adding)); DEBUG_printf(("border = %.1f, cellpadding = %.1f\n", table.border, table.cellp adding));
temp_bottom = bottom - table.cellpadding; temp_bottom = bottom - table.cellpadding;
temp_top = top + table.cellpadding; temp_top = top + table.cellpadding;
for (temprow = t->child, table.num_cols = 0, table.num_rows = 0, alloc_rows = 0, caption = NULL; for (temprow = t->child, table.num_cols = 0, table.num_rows = 0, alloc_rows = 0, caption = NULL;
skipping to change at line 6478 skipping to change at line 6517
tempcol != NULL && col < MAX_COLUMNS; tempcol != NULL && col < MAX_COLUMNS;
tempcol = tempcol->next) tempcol = tempcol->next)
{ {
if (tempcol->markup == MARKUP_TH && table.num_rows == 0) if (tempcol->markup == MARKUP_TH && table.num_rows == 0)
header_row = table.num_rows; header_row = table.num_rows;
if (tempcol->markup == MARKUP_TD || tempcol->markup == MARKUP_TH) if (tempcol->markup == MARKUP_TD || tempcol->markup == MARKUP_TH)
{ {
// Handle colspan and rowspan stuff... // Handle colspan and rowspan stuff...
if ((var = htmlGetVariable(tempcol, (uchar *)"COLSPAN")) != NULL) if ((var = htmlGetVariable(tempcol, (uchar *)"COLSPAN")) != NULL)
colspan = atoi((char *)var); {
if ((colspan = atoi((char *)var)) < 1)
colspan = 1;
else if (colspan > (MAX_COLUMNS - col))
colspan = MAX_COLUMNS - col;
}
else else
colspan = 1; colspan = 1;
if ((var = htmlGetVariable(tempcol, (uchar *)"ROWSPAN")) != NULL) if ((var = htmlGetVariable(tempcol, (uchar *)"ROWSPAN")) != NULL)
{ {
table.row_spans[col] = atoi((char *)var); table.row_spans[col] = atoi((char *)var);
if (table.row_spans[col] == 1) if (table.row_spans[col] <= 1)
table.row_spans[col] = 0; table.row_spans[col] = 0;
for (tcol = 1; tcol < colspan; tcol ++) for (tcol = 1; tcol < colspan; tcol ++)
table.row_spans[col + tcol] = table.row_spans[col]; table.row_spans[col + tcol] = table.row_spans[col];
} }
// Compute the cell size... // Compute the cell size...
col_width = get_cell_size(tempcol, 0.0f, table_width, &col_min, &col_p ref, &col_height); col_width = get_cell_size(tempcol, 0.0f, table_width, &col_min, &col_p ref, &col_height);
if ((var = htmlGetVariable(tempcol, (uchar *)"WIDTH")) != NULL) if ((var = htmlGetVariable(tempcol, (uchar *)"WIDTH")) != NULL)
{ {
skipping to change at line 6508 skipping to change at line 6552
{ {
col_width -= 2.0 * table.cellpadding - cellspacing; col_width -= 2.0 * table.cellpadding - cellspacing;
if (colspan <= 1) if (colspan <= 1)
table.col_percent[col] = 1; table.col_percent[col] = 1;
} }
else else
{ {
col_width -= 2.0 * table.cellpadding; col_width -= 2.0 * table.cellpadding;
} }
if (col_width <= 0.0f)
col_width = 0.0f;
else if (col_width > PageWidth)
col_width = PageWidth;
} }
else else
col_width = 0.0f; col_width = 0.0f;
tempcol->height = col_height; tempcol->height = col_height;
DEBUG_printf(("%d,%d: colsp=%d, rowsp=%d, width=%.1f, minw=%.1f, prefw= %.1f, minh=%.1f\n", col, table.num_rows, colspan, table.row_spans[col], col_widt h, col_min, col_pref, col_height)); DEBUG_printf(("%d,%d: colsp=%d, rowsp=%d, width=%.1f, minw=%.1f, prefw= %.1f, minh=%.1f\n", col, table.num_rows, colspan, table.row_spans[col], col_widt h, col_min, col_pref, col_height));
// Add widths to columns... // Add widths to columns...
if (colspan > 1) if (colspan > 1)
skipping to change at line 6591 skipping to change at line 6640
table.row_spans[col] --; table.row_spans[col] --;
} }
} }
/* /*
* OK, some people apparently create HTML tables with no columns or * OK, some people apparently create HTML tables with no columns or
* rows... If this happened, return immediately... * rows... If this happened, return immediately...
*/ */
if (table.num_cols == 0) if (table.num_cols == 0)
{
free(cells);
return; return;
}
/* /*
* Now figure out the width of the table... * Now figure out the width of the table...
*/ */
if ((var = htmlGetVariable(t, (uchar *)"WIDTH")) != NULL) if ((var = htmlGetVariable(t, (uchar *)"WIDTH")) != NULL)
{ {
if (var[strlen((char *)var) - 1] == '%') if (var[strlen((char *)var) - 1] == '%')
width = (float)(atof((char *)var) * (right - left) / 100.0f); width = (float)(atof((char *)var) * (right - left) / 100.0f);
else else
skipping to change at line 6974 skipping to change at line 7026
!htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN")) !htmlGetVariable(cells[row][col], (uchar *)"ROWSPAN"))
temp_height = cells[row][col]->height; temp_height = cells[row][col]->height;
if (table.height > 0.0) if (table.height > 0.0)
{ {
// Table height specified; make sure it'll fit... // Table height specified; make sure it'll fit...
if (temp_height > table.height) if (temp_height > table.height)
temp_height = table.height; temp_height = table.height;
temp_height -= 2 * table.cellpadding; temp_height -= 2 * table.cellpadding;
} }
else if (temp_height > (PageLength / 8) && height_var == NULL) else if (temp_height > (PageLength / 8.0) && height_var == NULL)
temp_height = PageLength / 8; temp_height = PageLength / 8.0;
} }
DEBUG_printf(("BEFORE row = %d, temp_height = %.1f, *y = %.1f, *page = %d\n" , DEBUG_printf(("BEFORE row = %d, temp_height = %.1f, *y = %.1f, *page = %d\n" ,
row, temp_height, *y, *page)); row, temp_height, *y, *page));
if (*y < (bottom + 2 * table.cellpadding + temp_height) && if (*y < (bottom + 2 * table.cellpadding + temp_height) &&
temp_height <= (top - bottom - 2 * table.cellpadding)) temp_height <= (top - bottom - 2 * table.cellpadding))
{ {
DEBUG_puts("NEW PAGE"); DEBUG_puts("NEW PAGE");
skipping to change at line 12116 skipping to change at line 12168
(TocFooter[j] && strstr(TocFooter[j], "$PAGE(A)"))) (TocFooter[j] && strstr(TocFooter[j], "$PAGE(A)")))
type = 'A'; type = 'A';
fprintf(out, "%d<</S/%c>>", i, type); fprintf(out, "%d<</S/%c>>", i, type);
i += chapter_ends[0] - chapter_starts[0] + 1; i += chapter_ends[0] - chapter_starts[0] + 1;
} }
for (j = 1; j <= TocDocCount; j ++) for (j = 1; j <= TocDocCount; j ++)
{ {
if (chapter_starts[j] < 0)
continue;
page = pages + chapter_starts[j]; page = pages + chapter_starts[j];
start = chapter_starts[j] - chapter_starts[1] + 1; start = chapter_starts[j] - chapter_starts[1] + 1;
type = 'D'; type = 'D';
prefix[0] = '\0'; prefix[0] = '\0';
for (k = 0; k < 3; k ++) for (k = 0; k < 3; k ++)
{ {
if (page->header[k] && strstr((char *)page->header[k], "PAGE")) if (page->header[k] && strstr((char *)page->header[k], "PAGE"))
strlcpy(prefix, (char *)page->header[k], sizeof(prefix)); strlcpy(prefix, (char *)page->header[k], sizeof(prefix));
skipping to change at line 12628 skipping to change at line 12683
encrypt_init(); encrypt_init();
if (!Compression) if (!Compression)
return; return;
compressor_active = 1; compressor_active = 1;
compressor.zalloc = (alloc_func)0; compressor.zalloc = (alloc_func)0;
compressor.zfree = (free_func)0; compressor.zfree = (free_func)0;
compressor.opaque = (voidpf)0; compressor.opaque = (voidpf)0;
deflateInit(&compressor, Compression); if (deflateInit(&compressor, Compression) < Z_OK)
{
progress_error(HD_ERROR_OUT_OF_MEMORY, "Unable to compress object in PDF fil
e.");
exit(1);
}
compressor.next_out = (Bytef *)comp_buffer; compressor.next_out = (Bytef *)comp_buffer;
compressor.avail_out = sizeof(comp_buffer); compressor.avail_out = sizeof(comp_buffer);
} }
/* /*
* 'flate_close_stream()' - Close a deflated output stream. * 'flate_close_stream()' - Close a deflated output stream.
*/ */
static void static void
 End of changes. 29 change blocks. 
17 lines changed or deleted 79 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)