简体   繁体   English

使用 Kingswaysoft 将注释上传到 Dynamics 365

[英]Upload annotation into Dynamics 365 using Kingswaysoft

I read a list of zip files, each one of them have one pdf file inside.我阅读了一份 zip 文件列表,每个文件里面都有一个 pdf 文件。 For this reading I use a script component in a SSIS package.对于本次阅读,我使用 SSIS package 中的脚本组件。 Once I read the pdf file I want to save a binary version of it in a sql server table.一旦我阅读了 pdf 文件,我想将它的二进制版本保存在 sql 服务器表中。 The column that stores the documentbody is VARBINARY(MAX) type.存储文档正文的列是 VARBINARY(MAX) 类型。

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.接下来我有一个 Kingswaysoft 组件,它读取这个表,其中每一行都是一个不同的文件,并将它们加载到 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.一切都没有错误,但是当我 go 并检查注释实体时,我打开 pdf 文件,里面是空的,空白页。

I believe it is something related with the encoding part.我相信这与编码部分有关。 Could you help me?你可以帮帮我吗?

In this case, we suggest using our SSIS Productivity Pack instead of the script component.在这种情况下,我们建议使用我们的SSIS 生产力包而不是脚本组件。 With the Compression Task , you can decompress the files, then use our Premium File System Source Component to read the extracted PDF files and write them to the annotation entity using our CRM Destination Component .使用压缩任务,您可以解压缩文件,然后使用我们的高级文件系统源组件读取提取的 PDF 文件,并使用我们的CRM 目标组件将它们写入注释实体。

If you require any further assistance, do not hesitate to reach out to our support team.如果您需要任何进一步的帮助,请随时联系我们的支持团队。

Getting empty pdf attachments when trying to create "activitymimeattachment" 尝试创建“activitymimeattachment”时获取空的 pdf 附件

I found a solution through this post:我通过这篇文章找到了解决方案:

I changed the typo of the arr variables to var .我将arr变量的拼写错误更改为var I really don't know why it didn't work before, but now it does.我真的不知道为什么它以前不起作用,但现在它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM