a previous thread (winforms) reported a similar error
https://www.syncfusion.com/forums/157886/loading-pdf-throws-exception-invalid-cross-reference-table
it was suggested that there was a dependency missing syncfusion.compression.net
I have updated all nuget packages but still receive this error on a variety of pdfs with tables and form
at first I thought it was because the template files (pdf) contained xfa form fields but it does not seem to be that. I have had pdfs opeing and been able to edit but that seems to have reverted to this 'corssreference table' error with latest 25.2.6
herewith code
mypdfv.LoadDocument(fs);
mypdfv.ZoomFactor = 2.5;
mypdfv.IsEnabled = true;
mypdfv.DocumentLoaded += Mypdfv_DocumentLoaded;
mypdfv.DocumentLoadFailed += Mypdfv_DocumentLoadFailed;
private void Mypdfv_DocumentLoadFailed(object? sender, DocumentLoadFailedEventArgs? e)
{
Console.WriteLine("Mypdfv_DocumentLoadFailed: " + e.Message);
DisplayAlert("Error", "failed to load PDF template \n" + e.Message, "OK");
}
private void Mypdfv_DocumentLoaded(object? sender, EventArgs? e)
{
int fieldCount = mypdfv.FormFields.Count;
Console.WriteLine("fieldCount: " + fieldCount);
copygartopdf();
// setfieldpdfv(mypdfv, "Registration", "2-OFUS");
}
and heres a couple of pdfs which report the error
Hi john murray,
We tried to replicate the reported issue with the provided details. The exception occurs when loading the shared document in SfPdfViewer. However, the document loaded properly without any exception on our side. We have attached a sample along with the output screenshot for your reference. It can be downloaded from the attachment.
If you are still able to replicate the issue in the shared sample, kindly modify the reproducing issue in the shared sample and share the updated sample with us. This will be helpful for us to provide a prompt solution at earliest.
Regards,
Deepika R
I got round problem by copying pdf into Word document changes some fields and saving it from word to a pdf. It seems (because this has happened before) that sfPdfviewer takes exception to some files
I am no expert in pdf and frankly I havent got the time to run to ground sfPdfviewer's invalid cross reference table error but thanks for looking at it
I maintain there is still an error in SFPdfviewer asa it seems to have happened before on xamarin (see previous mentioned thread) and once again you could not reproduce it. So I'll live with my workaround. tx again
Hi Jhon,
I'm glad to hear that copying the PDF into a Word document, making changes, and
saving it as a new PDF resolved the issue.
Sometimes the problem may lie with the PDF itself. If you other PDFs with the same issue, could you please share
them with us? This information will be helpful for
us to check further on our end.
Regards,
Manikandan M