We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Problem to convert DOCX to PDF

Hello,

I'm having some problem when I'm trying to convert a Word template to PDF in Syncfusion  Version 9.403.0.62. Can You help me with this problem. 

The Error is Below.

The main problem is when Im trying to convert to PDF the Objet WordDocument.
(convertWord.ConvertToPDF(documentTemplate)) Was not recognizing the object type, and display the error below:

1 - The type 'Syncfusion.DocIO.DLS.WordDocument' is defined in an assembly that is not referenced. You must add a reference to assembly 'Syncfusion.DocIO.Base, Version=9.403.0.62, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89'.

2 - The best overloaded method match for 'Syncfusion.DocToPDFConverter.DocToPDFConverter.ConvertToPDF(Syncfusion.DocIO.DLS.WordDocument)' has some invalid arguments

3 - Argument 1: cannot convert from 'Syncfusion.DocIO.DLS.WordDocument [c:\Presto_Luiz\Presto Santander Brasil\trunk\Ver2_1.1\SolnPrestoSantanderBrasil\WebPrestoSerfin\Recursos\Syncfusion.DocIO.Web.dll]' to 'Syncfusion.DocIO.DLS.WordDocument'        

The code than im using is below:

using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;
using Syncfusion.DocToPDFConverter;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Parsing;
var documentTemplate = new Syncfusion.DocIO.DLS.WordDocument();
var filePath = Path.Combine(Server.MapPath(@"~/" + ConfigurationManager.AppSettings["temaplte"]),file);
 documentTemplate.Open(filePath, FormatType.Docx);
// CODE.
.
.
.
var convertWord = new Conert.DocToPDFConverter();
PdfDocument pdf = convertWord.ConvertToPDF(documentTemplate);                              
using (var ms = new MemoryStream())
 {
     pdf.Save(ms);
     Session[file] = ms.ToArray();

 }

When i put the mouse's cursor in the object:

Cannot resolve method ‘ConvertToPDF(Syncfusion.DocIO.DLS.WordDocument)’, candidates are:
Syncfusion.Pdf.PdfDocument ConvertToPDF(string) (in class DocToPDFConverter) Syncfusion.Pdf.PdfDocument ConvertToPDF(Syncfusion.DocIO.DLS.WordDocument) (in class DocToPDFConverter) Syncfusion.Pdf.PdfDocument ConvertToPDF(System.IO.stream) (in class DocToPDFConvert)

Thanks


CODE_Minuta_51da0aa3.zip

4 Replies

JB Javier Briseño Perez-Verdia July 31, 2013 06:49 PM UTC

HI, 

Excuse the problem I'm having is in ASP.NET.

thank




PM Prasanth M B Syncfusion Team August 1, 2013 12:40 PM UTC

Hi Javier,

Thank you for using Syncfusion products.

Currently DocIO does not support Doc to PDF conversion by using DocIO in Partial trust mode. For performing Doc to PDF conversion, it is mandatory to use DocIO in Full trust mode. Please refer the below UG documentation link for details on Partial and full trust modes.

Partial and full trust mode:
http://help.syncfusion.com/ug/asp.net/docio/default.htm#!documents/aspnet.htm

For details on Doc to PDF conversion, please refer the below UG documentation link.

Doc to PDF conversion:
http://help.syncfusion.com/ug/asp.net/docio/default.htm#!documents/doctopdf.htm

We have prepared a Doc to PDF conversion sample. Please find the sample from the attachment.

Please let us know if you have any questions.

Regards,
Prasanth.



DocToPDF_Sample_dda91f9d.zip


JB Javier Briseño Perez-Verdia August 2, 2013 06:45 PM UTC

Hi Prasanth.

Thanks for the quick reply.
I managed to solve the problem really was using the reference partial moved to Full worked.

Thanks 


SV Sivasubramani V Syncfusion Team August 19, 2013 06:55 AM UTC

Hi Javier,

Thank you for your update.

Please let us know if you have any questions.

Regards,

Sivasubramani.V


Loader.
Live Chat Icon For mobile
Up arrow icon