I read a list of zip files, each one of them have one pdf file inside. For this reading I use a script component in a SSIS package. Once I read the pdf file I want to save a binary version of it in a sql server table. The column that stores the documentbody is VARBINARY(MAX) type.
This is the code I use for the reading an encoding part:
{
using (ZipArchive Archive = ZipFile.OpenRead(Row.documentpath))
foreach (ZipArchiveEntry Entry in Archive.Entries)
{
if (Path.GetExtension(Entry.Name) = "pdf")
{
using (StreamReader r = new StreamReader(Entry.Open()))
FullFile = r.ReadToEnd();
byte[] arr = System.Text.Encoding.UTF8.GetBytes(FullFile);
Next I have a Kingswaysoft component that reads this table, where each row is a different file, and load them into Dynamics.
Everything goes without errors but when I go and check the annotation entity, I open the pdf file and it's empty, blank pages inside.
I believe it is something related with the encoding part. Could you help me?