Aspose on Dynamics Online

Hello,

We have a need about generating PDF Documents in Dynamics Online et we have some questions about your product Aspose.

Here is our context :
We are working on a project in Dynamics 365 (Online – Office 365), and we would like to use the Aspose API on a plugin in the CRM to generate PDF Documents from CRM data and Word templates.
Can we do that ? what API have we to use ? what type of licence (for one developer) ?

We have do some tests with a demo API, but we have encountred this exception :

System.Security.SecurityException: Request for the permission of type ‘System.Security.Permissions.FileIOPermission,
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed

regards

Hi,

Thank you for your inquiry and sharing details.

You have to use Dynamic data to generate the PDF file but in order to deal with MS Word Template, Aspose.Pdf cannot help in this regard.

You will have to use Aspose.Words for Cloud API. For more information, please visit Developer Guide.

For license information, please visit Pricing Plan
.

If you have any further questions, please feel free to share.

Thanks,

Hi,



thanks for your answer.

But I want to convert word documents to PDF in Microsoft Online.

Can we do that with Aspose.Word for .NET ?



After merging our dll with yours(aspose.words.dll) and deploying it onto our plateform(sandbox) 365, we’ve got these errors:



System.Security.SecurityException: Request for the permission of type ‘System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed



thanks,

Prune

Hi,

Thank you for your inquiry.

To generate PDF file from dynamic data, please follow below steps

1- Use mail merge features with word documents to generated word document from dynamic data. Please visit link Using with Mail Merge features with Word documents

2- After generating word document from dynamic data use Convert a Document feature to convert word document to PDF. Please visit link Converting a Word Document to Images, Multipage TIFF, HTML, PDF or any other File Format using Cloud Storage

Regarding security issue, unfortunately it’s difficult to give you some exact recommendation on this issue. It is obviously related to some security policy settings on your machine. The point is that doesn’t seem to be an Aspose.Word bug but something that should be changed on your system configuration.

Please try and add this in web.config:

Hopefully this will solve security issue.

If you have any further questions, please feel free to share.

Thanks,

Naeem Akram
Aspose - File Format APIs.
Got a Complaint? File it!

Keep in touch! We’re on Twitter and Facebook

Hi,



We’re working on Microsoft Dynamics CRM 365 ONLINE. We don’t have any access to web.config.



We don’t need to generate word document from template (mail merge).



We have yet a word document attached to a note and we need to convert this document to PDF with Aspose programmatically (inside a plugin).

On onpremise environment, it works fine with Aspose.words .net.



When deploying the plugin on a sandbox environment (dynamics crm 365 online), it doesn’t work. Please, see below the error :



System.Security.SecurityException: Request for the permission of type ‘System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed



Could you tell us please what kind of Aspose work in that case because on your website you tell that it’s compatible with dynamics crm online and it’s worked.



regards,

Prune Dufosse

Here is our code :



Input parameter: array of word bytes (byte[] bit)

Output : array of pdf bytes (byte[] pdfb)

Licence as an embedded resource



public byte[] Word2PdfBytes(byte[] bit)

{

byte[] pdfb;

License lic = new License();

lic.SetLicense(“Aspose.Words.lic”);

using (MemoryStream ms = new MemoryStream(bit))

{

Document doc = new Document(ms);

using (MemoryStream pdfs = new MemoryStream())

{

doc.Save(pdfs, SaveFormat.Pdf);

pdfb = pdfs.ToArray();

}

}

return pdfb;

}

Hi Prune,

Thanks for your sharing the detail. The shared issue is not related to Aspose.Words. It seems that it is related to server security settings issue. Please check the following web links. Hope this helps you.
System.Security.SecurityException
Security Exception issue

A post was split to a new topic: Aspose for Dynamics Online

@pdufosse
Aspose.Words for .NET cannot be used in Dynamics Online plugins because those plugins have to sandboxed. Aspose Words for Cloud is web-based REST API so it can be used. We have recently released Aspose Words Cloud SDK for .NET as open-source library:

Again, you won’t be able to use it as DLL but you can fork the code into your project.
Hope that helps.