How to embed the PDFjs into your C# Project

TL;DR https://github.com/pvginkel/PdfiumViewer is recommended if you're okay with just viewing PDFs. If you need more complicated features, then convert the PDF into base64 and pass it to a javascript function which decodes and call the PDFViewerApplication.open which is implemented at viewer.js However, it's really, really slow. The example source is at https://github.com/heejune/WinForm-PDFjs If you needed … Continue reading How to embed the PDFjs into your C# Project

C# Conditional assembly reference

If you want to include assemblies conditionally upon its preprocessor from c# project, you can use Condition keyword. See the following snippet. xx.csproj <Reference Condition=" $(DefineConstants.Contains('XXX_LIB_OS')) " Include="DRVNAME1, Version=1.1.1.0, Culture=neutral, PublicKeyToken=xxxxx, processorArchitecture=AMD64"> ... </Reference> <Reference Condition=" $(DefineConstants.Contains('XXX_LIB_APP')) " Include="APPNAME1, Version=1.1.1.0, Culture=neutral, PublicKeyToken=xxxxxxx, processorArchitecture=AMD64"> ... </Reference> Then define the constant <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <DebugSymbols>true</DebugSymbols> <OutputPath> ... … Continue reading C# Conditional assembly reference