How to Start Tutorials Troubleshooting Main Operations Convert PDF Read PDF Edit PDF PDF Report Generator Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

C# PDF Library
How to handle common exceptions using XDoc.PDF?


Common exceptions, questions during using XDoc.PDF C# library.









1. Report errors to RasterEdge.com



If you get any exception in your .NET project using XDoc.PDF library, please add the following logging codes to your project, and send us the generated logging files, whose names like "~Log_2024[MMdd]_[hhmmss].txt".



RasterEdge.RELogger.Init(New RasterEdge.RELoggerConfig(inputFolder))
RasterEdge.RELogger.Start()
...
RasterEdge.RELogger.Stop()


Please send the following information to support@rasteredge.com:
1. Detailed error message information
2. XDoc.PDF dll version
3. All generated logging files
4. Sample PDF files







2. Could not load file or assembly 'RasterEdge.Imaging.Annotation'






If your used RasterEdge DLLs version does not match your .net platform, you will view this Exception "Could not load file or assembly 'RasterEdge.Imaging.Annotation' or one of its dependencies."



To fix it, you need choose right RasterEdge DLLs. We have provided DLLs for .NET 4.0 (x64, x86), .NET 3.5 (x64, x86). And our SDK does not support anyCPU platform.







3. Could not load file or assembly 'RasterEdge.Imaging.Font.DLL'



Three RasterEdge DLLs are using C++ to develop, and the rest of them are using C#.

The three DLLs are:
RasterEdge.Imaging.Font.dll
RasterEdge.XImage.OCR.Tesseract.dll
RasterEdge.XImage.Raster.Core.dll

If your system has not installed C++ library, it will throw the following Exception "Could not load file or assembly 'RasterEdge.Imaging.Font.DLL' or one of its dependencies"



To fix it,

If you are using RasterEdge .net 2.0 dll, you must install Visual C++ 2005 Redistributable Package.
If you are using RasterEdge .net 4.0 dll, you must install Visual C++ 2010 Redistributable Package.

Please download the Microsoft VC++ redistribution package:
Microsoft Visual C++ 2010 Redistributable Package (x86) https://www.microsoft.com/en-us/download/details.aspx?id=5555
Microsoft Visual C++ 2010 Redistributable Package (x64) https://www.microsoft.com/en-us/download/details.aspx?id=14632