The input string 'CreatorInfo' was not in a correct format while loading the PDF

We are observing an exception whenever we are trying to load some of the pdfs using code below

Document document = new Document(pdfStream);

Exception : The input string ‘CreatorInfo’ was not in a correct format

Unfortunately we cannot share these confidential PDFs

We would like to know if there is any way to bypass the metadata missing or corrupt errors in PDFs

@cpaperless

Why the exception is thrown

When Aspose.PDF loads a file it parses the document‑level metadata (the Info dictionary and any XMP packet).
In the PDFs that raise

The input string 'CreatorInfo' was not in a correct format

the CreatorInfo entry contains a value that cannot be converted to the expected type (normally a string or a date). While reading the metadata Aspose.PDF throws a FormatException.

How to load the file despite the bad metadata

Aspose.PDF provides a load‑option that tells the parser to ignore metadata that cannot be parsed.

using Aspose.Pdf;
using Aspose.Pdf.LoadOptions;

// pdfStream – a Stream that contains the PDF bytes
PdfLoadOptions loadOptions = new PdfLoadOptions
{
    // Skip any malformed metadata entries (e.g., CreatorInfo)
    IgnoreCorruptedMetadata = true
};

Document doc = new Document(pdfStream, loadOptions);
  • IgnoreCorruptedMetadata = true – the loader skips any metadata entry that cannot be read. All pages, content streams, annotations, etc., are still loaded normally.

When this works

  • The PDF structure (objects, cross‑reference table, page streams) is intact.
  • Only the metadata (Info dictionary / XMP) is malformed.

If the problem persists

When the file still cannot be opened, the corruption is deeper than just the metadata. In that case you can try one of the following approaches:

Approach How to use it
Upgrade Aspose.PDF Newer releases (23.10 +) contain more robust repair logic.
Repair with PdfFileEditor csharp\nPdfFileEditor editor = new PdfFileEditor();\neditor.Repair(pdfStream, repairedStream);\n
Load in memory‑optimized mode and re‑save csharp\nPdfLoadOptions opt = new PdfLoadOptions\n{\n IgnoreCorruptedMetadata = true,\n LoadMode = LoadMode.MemoryOptimized // reduces memory pressure\n};\n\nDocument src = new Document(pdfStream, opt);\nDocument dest = new Document();\n\ndest.Pages.Add(src.Pages);\ndest.Save(\"repaired.pdf\");\n

Important notes

Item Detail
Required version IgnoreCorruptedMetadata is available from Aspose.PDF for .NET 23.10. If you are on an earlier version, upgrade or use the repair workflow shown above.
Effect on metadata Corrupted entries are simply omitted; they are not corrected. If you need the original values, the source PDF must be fixed.
Performance Ignoring metadata adds negligible overhead. Adding LoadMode = LoadMode.MemoryOptimized can help when processing many large files.

Summary

PdfLoadOptions opts = new PdfLoadOptions { IgnoreCorruptedMetadata = true };
Document pdf = new Document(pdfStream, opts);

Setting IgnoreCorruptedMetadata allows Aspose.PDF to bypass the malformed CreatorInfo (or any other bad metadata) and load the document normally. If the file still fails to open, upgrade the library, use PdfFileEditor.Repair, or reload in memory‑optimized mode and re‑save the PDF.

1 Like

We are using “Aspose.PDF.Drawing” with version “24.10.0”
We don’t see any property called “IgnoreCorruptedMetadata” under PdfLoadOptions

@cpaperless

We apologize for any confusion caused. This response was automatically generated by the AI, and we are actively working to enhance its accuracy. In the meantime, could you kindly share your sample PDF document for our reference? This will help us test the scenario in our environment and address it appropriately.