views:

17

answers:

1

I am currently developing a utility class as a part of my business layer. The task of this class is to load a template PDF file, fill out the PDF with iTextSharp and return the resulting stream. I am having some "analysis paralysis" as to how to store the predefined PDF templates in my business layer. Do I throw all of my PDFs into a folder and mark each file as an "embedded resource"? Basically, I'm just looking for a direction towards some of the more commonly used best practices when it comes to storing/accessing assembly resources (which I consider to be any file that does not execute code).

A: 

Sure, you can absolutely mark them as embedded resources. A newer way is to add them using the the Project, Project Name, Properties, Resources tab. This will give you an easy, strongly-typed way to access them through the Properties.Resources.ResourceName syntax.

Both mechanisms are common ways to handle reasonably-sized content that you want to manage as part of your application development. Standalone files are preferable for large content (such as videos), content that might need replaced without recompiling the assembly, or (in some cases) content that is maintained outside of your application development process.

binarycoder