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.
Unfortunately, activation email could not send to your email. Please try again.

Problem to convert DOCX to PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

110380 Jul 31,2013 01:52 PM Aug 19,2013 02:55 AM Windows Forms 4
loading
Tags: DocIO
Javier Briseño Perez-Verdia
Asked On July 31, 2013 01:52 PM

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

Javier Briseño Perez-Verdia
Replied On July 31, 2013 02:49 PM

HI, 

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

thank



Prasanth M B [Syncfusion]
Replied On August 1, 2013 08:40 AM

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

Javier Briseño Perez-Verdia
Replied On August 2, 2013 02:45 PM

Hi Prasanth.

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

Thanks 

Sivasubramani V [Syncfusion]
Replied On August 19, 2013 02:55 AM

Hi Javier,

Thank you for your update.

Please let us know if you have any questions.

Regards,

Sivasubramani.V


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;