When adding/changing a title/author to a pdf and then save the pdf with SaveDocument(const FileStream: TStream) works for most pdf viewers. There is an issue for the chrome adobe acrobat extension. This extension will not open the file.
Not much wrong with the file but there is an issue with the xref, the extension probably recognizes 21 bytes instead of 20 due to the CRLF
Working pdf:
And a pdf after this is saved with the pdflib
Removing the CR from the xref solves the issue of the file not opening in the chrome adobe acrobat extension.
I think that the issue can be solved by removing #13 in procedure TTMSFNCPDFCore.SaveToStream(const AStream: TStream)
XRefOffset := AStream.Position;
WriteRaw(AStream, RawByteString('xref'#10'0 ' + IntToStr(MaxNumber + 1) + #10));
WriteRaw(AStream, '0000000000 65535 f '#13#10);
for I := 1 to MaxNumber do
if Active[I] then
WriteRaw(AStream, RawByteString(Format('%.10d 00000 n '#13#10,
[Offsets[I]])))
else
WriteRaw(AStream, '0000000000 00000 f '#13#10);

