Word Automation Services Error Code 6

Hi

I am converting one single document into pdf using Word Automation Services SharePoint 2010. When I run simple code

Input parameters for the script
$wordFile="http://sharepointserver/documents/word.docx"
$pdfFile="http://sharepointserver/documents/pdf.pdf" 
# Get the Word Automation Service Proxy
$wasp = Get-SPServiceApplicationProxy | where { $_.TypeName -eq "Word Automation Services Proxy" }
#Create the Conversion job
$conversionJob = New-Object Microsoft.Office.Word.Server.Conversions.ConversionJob($wasp)
# Get the web url
$web = Get-SPWeb "http://sharepointserver/" 
# Set the credentials to use when running the conversion job.
$conversionJob.UserToken = $web.CurrentUser.UserToken
# Conversion Job Name
$conversionJob.Name = "Convert docx to PDF"
$conversionJob.Settings.OutputFormat = [Microsoft.Office.Word.Server.Conversions.SaveFormat]::PDF
$conversionJob.AddFile($wordFile,$pdfFile)
# Start the conversion job
$conversionJob.Start()

It generate error code 6 in database. I checked everything and have given same user permissions every where. I could not resolve this issue. It is not db issue. I seen Event ID 1001 resolution as well and have gone through this process. But still in vain.

Can anyone help in this issue?


April 29th, 2014 10:22am

Hi,

According to your post, my understanding is that you wanted to convert the document into pdf using the word automation service SharePoint 2010.

I had used the following code snippets to convert the document to pdf, and it worked well, you can try the following code, then check whether it works.

[void][System.Reflection.Assembly]::LoadWithPartialName( "Microsoft.Office.Word.Server" )

$jobSettings = New-Object Microsoft.Office.Word.Server.Conversions.ConversionJobSettings

$jobSettings.OutputFormat = "PDF"

$job = New-Object Microsoft.Office.Word.Server.Conversions.ConversionJob( "Word Automation", $jobSettings )

$job.UserToken = (Get-SPWeb http://sp).CurrentUser.UserToken

$job.AddFile( "http://sp/libA/test3.docx", "http://sp/libA/pdf.pdf" )

$job.Start( )

More reference: http://sharepointburger.wordpress.com/2011/12/12/word-automation-services-visual-walkthrough/

Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2014 2:58am

Thanks for your quick reply. I have tested this script and getting below error message in db. I have given same account and this account is having full permission in application pool as well as db.  Even I have run this code 

$sp = Get-SPServiceApplication | where {$_.TypeName.Equals("Word Automation Services")}
$sp.DisableSandbox = $true
$sp.Update()

What could be the issue? Is it infrastructure issue or something else?


 
April 30th, 2014 4:17am

Thanks for your quick reply. I have tested this script and getting below error message in db. I have given same account and this account is having full permission in application pool as well as db.  Even I have run this code 

$sp = Get-SPServiceApplication | where {$_.TypeName.Equals("Word Automation Services")}
$sp.DisableSandbox = $true
$sp.Update()

What could be the issue? Is it infrastructure issue or something else?


 
Free Windows Admin Tool Kit Click here and download it now
April 30th, 2014 11:16am

Hi PriaseWorthy<abbr class="affil"></abbr>,

am also getting same error code 6 as you  had in Database, could you please let us know did you have fix for it.

Br,

Syam

January 29th, 2015 5:33am

Hi PriaseWorthy<abbr class="affil"></abbr>,

am also getting same error code 6 as you  had in Database, could you please let us know did you have fix for it.

Br,

Syam

Free Windows Admin Tool Kit Click here and download it now
January 29th, 2015 5:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics