Skip to content

Commit e996898

Browse files
committedFeb 21, 2025··
Back out object stream changes, as they would require much more significant
reworking of the "write value" private API that I don't want to do right now.
1 parent aa6a20c commit e996898

File tree

2 files changed

+1
-38
lines changed

2 files changed

+1
-38
lines changed
 

‎pdfio-file.c

+1-33
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ static bool load_obj_stream(pdfio_obj_t *obj);
2626
static bool load_pages(pdfio_file_t *pdf, pdfio_obj_t *obj, size_t depth);
2727
static bool load_xref(pdfio_file_t *pdf, off_t xref_offset, pdfio_password_cb_t password_cb, void *password_data);
2828
static bool repair_xref(pdfio_file_t *pdf, pdfio_password_cb_t password_cb, void *password_data);
29-
static bool write_obj_streams(pdfio_file_t *pdf);
3029
static bool write_pages(pdfio_file_t *pdf);
3130
static bool write_trailer(pdfio_file_t *pdf);
3231

@@ -122,7 +121,7 @@ pdfioFileClose(pdfio_file_t *pdf) // I - PDF file
122121
{
123122
ret = false;
124123

125-
if (pdfioObjClose(pdf->info_obj) && write_pages(pdf) && write_obj_streams(pdf) && pdfioObjClose(pdf->root_obj) && write_trailer(pdf))
124+
if (pdfioObjClose(pdf->info_obj) && write_pages(pdf) && pdfioObjClose(pdf->root_obj) && write_trailer(pdf))
126125
ret = _pdfioFileFlush(pdf);
127126
}
128127

@@ -2344,37 +2343,6 @@ repair_xref(
23442343
}
23452344

23462345

2347-
//
2348-
// 'write_obj_streams()' - Write object streams...
2349-
//
2350-
2351-
static bool // O - `true` on success, `false` on error
2352-
write_obj_streams(pdfio_file_t *pdf) // I - PDF file
2353-
{
2354-
size_t i; // Looping var
2355-
pdfio_obj_t *obj; // Current object
2356-
2357-
2358-
// Object streams are part of PDF 1.5 and later...
2359-
if (strcmp(pdf->version, "1.5") < 0)
2360-
return (true);
2361-
2362-
// Loop through the file objects and write any to an object stream...
2363-
for (i = 0; i < pdf->num_objs; i ++)
2364-
{
2365-
obj = pdf->objs[i];
2366-
2367-
if (obj->offset > 0)
2368-
continue;
2369-
2370-
if (!_pdfioObjWriteHeader(obj) || !_pdfioFilePuts(pdf, "endobj\n"))
2371-
return (false);
2372-
}
2373-
2374-
return (true);
2375-
}
2376-
2377-
23782346
//
23792347
// 'write_pages()' - Write the PDF pages objects.
23802348
//

‎pdfio-object.c

-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ pdfioObjClose(pdfio_obj_t *obj) // I - Object
3434
// Write what remains for the object...
3535
if (!obj->offset)
3636
{
37-
// If we are writing a PDF 1.5 or later object, put all value-only objects
38-
// in object streams...
39-
if (obj != obj->pdf->encrypt_obj && obj != obj->pdf->info_obj && obj != obj->pdf->root_obj && strcmp(obj->pdf->version, "1.5") >= 0)
40-
return (true);
41-
4237
// Write the object value
4338
if (!_pdfioObjWriteHeader(obj))
4439
return (false);

0 commit comments

Comments
 (0)
Please sign in to comment.