Skip to content

Validate PDF/check startxref #769

Answered by digitaldirk
digitaldirk asked this question in Q&A
Discussion options

You must be logged in to vote

Simple solution to my issue:
I got the bytes of the base64 string then decoded the bytes into the raw string of the PDF, then checked if the raw PDF string contained startxref.

var bytes = Convert.FromBase64String(base64input);
string rawPDF = Encoding.UTF8.GetString(bytes);
if (rawPDF.Contains("startxref"))
{
...
}

Maybe an option to skip bad PDF's could be added to the Merge call?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by digitaldirk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant