Cross reference table or cross reference stream not found

Hi ,


Find attached task.

Document pdf = new Document(“FilePath”); // throws error

It is throwing error : “Cross reference table or cross reference stream not found”.

Aspose.Pdf Runtime version : V4.0.30319

Any help would be appreciated…

Hello Jim,


Thanks for contacting support.

I have tried to open your shared document with Aspose.Pdf for .NET 17.5 and was unable observe any issue. Please note that it is always recommended to use latest version of the API as it contains all fixes and enhancement. Please download latest version from the link given above and in case if you still face any issue, please feel free to let us know.


Best Regards,

asad.ali,

I am also facing same issue,Please help as soon as possible.
As you suggest i am using latest version18.0.5 aspose pdf library but still no use.
pdfHexData.zip (106.5 KB)

            OutPutMObje = new MemoryStream(bytesToWrite);

Aspose.Pdf.Document doc = new Aspose.Pdf.Document(OutPutMObje);

@syedbashur

Thanks for contacting support.

The file which you have shared, contains byte data in string format. We have tried to generate byte array from this data and load into MemoryStream, by using following method.

public static byte[] StringToByteArray(String hex)
{
  int NumberChars = hex.Length;
  byte[] bytes = new byte[NumberChars / 2];
  for (int i = 0; i < NumberChars; i += 2)
     bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
  return bytes;
}

However, we could not get success while getting byte array, as the data seems corrupted. Would you please share the complete code snippet, which you are using to read the HEX string and loading it into MemoryStream. We will test the scenario in our environment and address it accordingly.