System.IO.FileNotFoundException

1 Answer 64 Views
PdfProcessing
Jana
Top achievements
Rank 2
Iron
Iron
Iron
Jana asked on 15 Mar 2023, 03:20 PM | edited on 15 Mar 2023, 03:30 PM

Hello, 

I'm currently testing the Telerik PDFProcessingLibrary and I wanted to try out the example as described in your documentation https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/getting-started

I have created a simple console application in .NET 6 in VS Professional 2022 version 17.3.6. 

The code is the following:


using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
using Telerik.Windows.Documents.Fixed.Model;
using Telerik.Windows.Documents.Fixed.Model.Editing;

RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);
editor.DrawText("Hello RadPdfProcessing!");
PdfFormatProvider provider = new PdfFormatProvider();

using (Stream output = File.OpenWrite("Hello.pdf"))
{
    provider.Export(document, output);
}

If I add the references manually from the Telerik installation on my PC, I receive the following exception:

If I add them using NuGet, it's the following exception:

Do you have an idea from where it can come? Do you need further information in order to help out?

Thank you in advance and have a nice day!

Jana

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 16 Mar 2023, 12:04 PM

Hello Jana,

This behavior is observed when different assemblies than the required ones are being used. In this case, the assemblies for .NET Standard need to be referenced (they are the ones without 'Windows' in their name). More information on the possible cause and fix to the exceptions you are experiencing can be found in the following articles: 

Let me know if I can assist you further.

Regards, Yoan Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
PdfProcessing
Asked by
Jana
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Yoan
Telerik team
Share this question
or