Free Support Forum - aspose.com

Docx to pdf converter problem sharepoint

I have created a docx converter per your sample code with 6.4. Basicly using the exact code.

I am getting the following error

The document converter was not able to convert the file.

Log file shows

Document Converter Word Document to PDF failed with error code: CE_OTHER

The converter shows up in the list document dropdown and opens the default screen Document Conversion: test.docx

The docx itself is just a couple lines of test text.

Feature.xml

http://schemas.microsoft.com/sharepoint/"

Id="{C0ADDD16-A482-4f0d-A858-3F42EC09D504}"

Title="DOCX to PDF Converter (by Aspose)"

Description="Makes it possible to convert documents from DOCX to PDF."

Scope="WebApplication">

Elements.xml file

http://schemas.microsoft.com/sharepoint/">

<DocumentConverter Id="{DB1587D1-31B0-4ada-9F7C-D4945DAABA58}"

Name="Word Document to PDF"

App="DocxToPDF.exe"

From="docx"

To="Pdf"

/>

CODE IS AS Follows

using System;
using System.IO;
using Aspose.Words;

namespace DocxToPDF
{

///

/// DOC2PDF document converter for SharePoint.

/// Uses Aspose.Words to perform the conversion.

///

public class ExMossDoc2Pdf
{

///

/// The main entry point for the application.

///

[STAThread]

static void Main(string[] args)
{

// Although SharePoint passes "-log " to us and we are

// supposed to log there, for the sake of simplicity, we will use

// our own hard coded path to the log file.

//

// Make sure there are permissions to write into this folder.

// The document converter will be called under the document

// conversion account (not sure what name), so for testing purposes

// I would give the Users group write permissions into this folder.

gLog = new StreamWriter(@"C:\Aspose2Pdf\log.txt", true);

try
{

gLog.WriteLine(DateTime.Now.ToString() + " Started");

gLog.WriteLine(Environment.CommandLine);

ParseCommandLine(args);

// Uncomment the code below when you have purchased a licenses for Aspose.Words.

//

// You need to deploy the license in the same folder as your

// executable, alternatively you can add the license file as an

// embedded resource to your project.

//

// // Set license for Aspose.Words.

// Aspose.Words.License wordsLicense = new Aspose.Words.License();

// wordsLicense.SetLicense("Aspose.Total.lic");

ConvertDoc2Pdf(gInFileName, gOutFileName);

}

catch (Exception e)
{

gLog.WriteLine(e.Message);

Environment.ExitCode = 100;

}

finally
{

gLog.Close();

}

}

private static void ParseCommandLine(string[] args)
{

int i = 0;

while (i < args.Length)
{

string s = args[i];

switch (s.ToLower())
{

case "-in":

i++;

gInFileName = args[i];

break;

case "-out":

i++;

gOutFileName = args[i];

break;

case "-config":

// Skip the name of the config file and do nothing.

i++;

break;

case "-log":

// Skip the name of the log file and do nothing.

i++;

break;

default:

throw new Exception("Unknown command line argument: " + s);

}

i++;

}

}

private static void ConvertDoc2Pdf(string inFileName, string outFileName)
{

// You can load not only DOC here, but any format supported by

// Aspose.Words: DOC, RTF, WordML, HTML.

Document docx = new Document(inFileName);

docx.Save(outFileName, SaveFormat.Pdf);

}

private static string gInFileName;

private static string gOutFileName;

private static StreamWriter gLog;

}

}

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Most likely you have missed something in configuration or during activating the feature. Unfortunately, I cannot help you in this case, we essentially refusing to provide technical support for SharePoint.

You can also check the following thread, maybe information provided there could be useful for you.

http://www.aspose.com/community/forums/2/147254/convert-doc-to-pdf-in-moss-2007/showthread.aspx

Best regards.

Figured out what was wrong Doc converters will NOT work on a Domain Controllers because the run under the context of a local user account which don't exist on DC's.

Once I moved from my local vm to my Dev server the converter works.

Hope this helps someone else.

It is perfect that you have found the solution. Thank you for posting this information in the forum.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Best regards.

Hi!

We are delighted to announce the availability of Aspose.Words for SharePoint, which is our latest addition to the Aspose.Words product family.

This release, Aspose.Words for SharePoint 1.0 makes high quality document conversions for DOC/DOCX/ODT/RTF/PDF/XPS and others easily accessible to SharePoint users.

Please find more details in our Documentation area.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(27)

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan