PDF Title Showing as random characters after Optimisation

Hi there,

I am using the trial version of Aspose.PDF and when I use the Optimize function the resulting PDF shows in browsers with random characters instead of the actual title.

The file will initially open with the correct name and then revert to a string of characters such as:

¯,⁄Ý`Waé™ vsÓG

Previous versions of the PDF before using Optimize work correctly. Can someone advise to why this is and if it is supposed to happen or not?

Many thanks,

Nick

@ndb1988
Please attach the document and code you used.

Code is a basic function used in a COM Wrapper, affected_pdf is the resultant pdf with the malformed characters in the name, original_pdf was the pdf passed to the function:

        public void optimisePDF(string inputPath, string outputPath)
            {

                // Open document
                using (Document document = new Document(inputPath))
                {

                // Optimize for web
                    document.Optimize();

                // Save output document
                    document.Save(outputPath);
                }

            }

affected_pdf.pdf (659.0 KB)

original_pdf.pdf (577.9 KB)

The file size has also seemed to increase after optimisation, unsure if this is supposed to happen either.

@ndb1988
Thanks for the information provided.
I checked for Google Chrome - there really is such an effect (regardless of the license). On this occasion, I will create a task for the development team. According to the size of the resulting file, I had 577 KB for initial, optimized is 576 KB.

@ndb1988
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56785

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks Sergei.

If you can keep me updated that would be great.

Cheers.

@ndb1988
Yes, of course, if there is anything new on this issue, I will let you know.

Hi @sergei.shibanov ,

I am still receiving the same outcome when trying to optimise PDFs e.g. the resultant PDF is of a size larger than the original (minimal but still larger). The code I am using is the simple method above, an example would be the originally provided two PDFs for the other issue.

Is there anything I am doing wrong that would be causing this as I know you said when you tried you received a 1KB change from input to output PDF.

Thanks for the help,

ndb

@ndb1988
What version of the library and sdk are you using?
(I tested with 24.2 in .Net 6)