Skip to content

Commit

Permalink
Pdfa 1a (#215)
Browse files Browse the repository at this point in the history
* add 4th byte >127 to the comment after the header to comply with ISO190005-1 6.1.2

* Add a line separator to ModifyPDFForStream to comply with ISO190005-1 standard when using IUs to modify a pdf
  • Loading branch information
jjelosua authored Jul 6, 2023
1 parent 898b8da commit bd78336
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions PDFWriter/DocumentContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ void DocumentContext::WriteHeaderComment(EPDFVersion inPDFVersion)
}
}

static const IOBasicTypes::Byte scBinaryBytesArray[] = {'%',0xBD,0xBE,0xBC,'\r','\n'}; // might imply that i need a newline writer here....an underlying primitives-token context
static const IOBasicTypes::Byte scBinaryBytesArray[] = {'%',0xBD,0xBE,0xBC,0xB5,'\r','\n'}; // might imply that i need a newline writer here....an underlying primitives-token context

void DocumentContext::Write4BinaryBytes()
{
IByteWriterWithPosition *freeContextOutput = mObjectsContext->StartFreeContext();
freeContextOutput->Write(scBinaryBytesArray,6);
freeContextOutput->Write(scBinaryBytesArray,7);
mObjectsContext->EndFreeContext();
}

Expand Down
3 changes: 2 additions & 1 deletion PDFWriter/PDFWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ EStatusCode PDFWriter::ModifyPDFForStream(
}

mObjectsContext.SetOutputStream(inModifiedDestinationStream);

mObjectsContext.WriteTokenSeparator(eTokenSeparatorEndLine);

mIsModified = true;

return SetupStateFromModifiedStream(inModifiedSourceStream, thisOrDefaultVersion(inPDFVersion), inPDFCreationSettings);
Expand Down

0 comments on commit bd78336

Please sign in to comment.