Convert dotx or docx to pdf with Word Automation Service failed
Hello everybody,
After search on the internet, I'm looking for a solution to this issue.
I wrote this code for a document conversion in a visual studio 2010 workflow:
string wordAutomationServiceName = "Word Automation Service";
ConversionJobSettings jobSettings = new ConversionJobSettings();
jobSettings.OutputFormat = SaveFormat.PDF;
ConversionJob job = new ConversionJob(wordAutomationServiceName, jobSettings);
job.UserToken = workflowProperties.Site.UserToken;
job.AddFile(workflowProperties.WebUrl + "/" + file.Url,
workflowProperties.WebUrl + "/" + file.Url.Replace(".docx", ".pdf"));
job.Start();
URLs are corrects and the word document exists.
The problem is when the job is executed, I have errors in SharePoint logs:
11/18/2011 09:24:15.87 w3wp.exe (0x1BC4) 0x1CA0 Word Automation Services
Office Viewing Architecture 9rte Medium Request received for document 00000001-0001-10e2-80af-d08c970b9892, format: , numberInQueue: 0, request id ba03fb58-55b2-4c6c-b1ca-20fad3b11585
00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.87 w3wp.exe (0x1BC4) 0x1CA0 Word Automation Services
Office Viewing Architecture c7ld Medium AppManager.BeginProcessRequest adding request to queue 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.88 w3wp.exe (0x1BC4) 0x1CA0 Word Automation Services
Timer Job g27p Medium Local Controller '71cf62b9-c34c-46c4-9828-55de2d5f5ac0':
In Progress: <http://site/Contracts/docsettest/contracttest.dotx> downloaded and queued locally 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.88 w3wp.exe (0x1BC4) 0x17C0 Word Automation Services
Configuration g6xc Medium Item 00000001-0001-10e2-80af-d08c970b9892: Assigned to
local worker process: 1D64 (7524; worker id = cce33245-48b9-4b0d-afcd-e3218845d81a) 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.88 w3wp.exe (0x1BC4) 0x1CA0 SharePoint Foundation
Monitoring b4ly Medium Leaving Monitored Scope (ExecuteWcfServerOperation).
Execution Time=23.6994391735768 2fd2393d-f36d-49a1-bfdf-737aefc8659a
11/18/2011 09:24:15.88 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture vipp Medium AppWorker:cce33245-48b9-4b0d-afcd-e3218845d81a initializing for request ba03fb58-55b2-4c6c-b1ca-20fad3b11585
00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.88 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture vipr Monitorable AppWorker:cce33245-48b9-4b0d-afcd-e3218845d81a worker call failed System.ServiceModel.CommunicationObjectAbortedException: The
communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it has been Aborted. Server stack trace: at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen()
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Re...
00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.88* w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture vipr Monitorable ...moting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type) at Microsoft.Office.Web.Conversion.Framework.Remoting.IAppChannelCallback.Initialize(WorkerRequest request, FileItem fileItem) at Microsoft.Office.Web.Conversion.Framework.AppWorker.ProcessRequest(ConversionRequest
request). Worker name WordAutomationServices, Document 00000001-0001-10e2-80af-d08c970b9892 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.88 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Service g281 Medium Local Controller '71cf62b9-c34c-46c4-9828-55de2d5f5ac0':
Failure: <http://site/Contracts/docsettest/contracttest.dotx> not uploaded to <http://site/Contracts/docsettest/contracttest.pdf> (65543) 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.90 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture c78j Unexpected AppWorker:cce33245-48b9-4b0d-afcd-e3218845d81a ProcessRequestDone() received error response WorkerException, restarting the worker
00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.90 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture b1qa Medium Shutting down process with force processId: 7524 belonging to AppWorker cce33245-48b9-4b0d-afcd-e3218845d81a
00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.91 w3wp.exe (0x1BC4) 0x1CA0 Word Automation Services
Configuration g6xb Medium Local Controller '71cf62b9-c34c-46c4-9828-55de2d5f5ac0':
Local worker process exited: 1D64 (7524); exit time = 11/18/2011 09:24:15
11/18/2011 09:24:15.91 w3wp.exe (0x1BC4) 0x1CA0 Word Automation Services
Configuration d0md Medium App 'Word Automation Service': Deleting temp directory
'C:\Windows\TEMP\wdsrv\21659d2e-c634-46a2-9585-b4cd1398f64c\odsibdmm.cmv\1D64'
11/18/2011 09:24:15.92 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture xpre Medium Removing worker cce33245-48b9-4b0d-afcd-e3218845d81a, thread: 216 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.92 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture f2yg Medium CreateSandBoxedProcessWorker() is called 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture b10e Medium Created desktop: Service-0x0-3eaf55d$\Microsoft Office Isolated Environment 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture 2brt Medium AppWorker:89d80fff-43ec-459e-9d95-5ed8b67f20bb worker process is started Exe: WordServerWorker.exe Args: /id 89d80fff-43ec-459e-9d95-5ed8b67f20bb
/convertingService net.pipe://127.0.0.1/WordServer71cf62b9-c34c-46c4-9828-55de2d5f5ac0 /assembly WdsrvWorker.dll /type WACWS /IsBatchedTracing True /LogQuota 100 WorkerType: WorkerType1 Directory: c:\windows\system32\inetsrv, pid : 3700, IsSandBoxed: True,
UniqueSandBoxSid: S-1-5-26473-19571-45394-48 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture vioz Medium RemoveWorker isRemoved: True session id : uuid:c9cce13b-5285-47d6-a666-29da19e57c67;id=47, Guid: cce33245-48b9-4b0d-afcd-e3218845d81a
00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture b4em Monitorable AppWorker:cce33245-48b9-4b0d-afcd-e3218845d81a recycle worker process because the conversion failed with result WorkerException.
Worker is WordAutomationServices 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture xpre Medium Removing worker cce33245-48b9-4b0d-afcd-e3218845d81a, thread: 216 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture vioz Medium RemoveWorker isRemoved: False session id : uuid:c9cce13b-5285-47d6-a666-29da19e57c67;id=47, Guid: cce33245-48b9-4b0d-afcd-e3218845d81a
00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x211C Word Automation Services
Office Viewing Architecture a2oj Medium PreProcessTime = 0; InConversionQueueTime = 0.0019142; ResponseTime = 0.0066997; TotalConversionTime = 0.0535976; AvgPreProcessTime
= 0; AvgInConversionQueueTime = 0; AvgResponseTime = 0; AvgTotalConversionTime = 0; historyCount = 0; result = WorkerException; format = n/a 00000001-0001-10e2-80af-d08c970b9892
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x144C Word Automation Services
Office Viewing Architecture 4sig Medium ChildProcess WordServerWorker.exe is launched inside worker 89d80fff-43ec-459e-9d95-5ed8b67f20bb. Pid 3700
11/18/2011 09:24:15.93 w3wp.exe (0x1BC4) 0x144C Word Automation Services
Office Viewing Architecture d9hn Medium NotifyNewChildProcessInWorker has seen WordServerWorker.exe in worker 89d80fff-43ec-459e-9d95-5ed8b67f20bb
11/18/2011 09:24:16.45 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture viou Medium ... registering worker 89d80fff-43ec-459e-9d95-5ed8b67f20bb
11/18/2011 09:24:16.48 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture viox Medium Worker 89d80fff-43ec-459e-9d95-5ed8b67f20bb is now initialized.
11/18/2011 09:24:16.55 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture vipx Monitorable AppWorker:89d80fff-43ec-459e-9d95-5ed8b67f20bb application server host exited unexpectedly (thread: 6)
11/18/2011 09:24:16.55 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture c78j Unexpected AppWorker:89d80fff-43ec-459e-9d95-5ed8b67f20bb ProcessRequestDone() received error response WorkerCrashed, restarting the worker
11/18/2011 09:24:16.57 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture xpre Medium Removing worker 89d80fff-43ec-459e-9d95-5ed8b67f20bb, thread: 6
11/18/2011 09:24:16.57 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture f2yg Medium CreateSandBoxedProcessWorker() is called
11/18/2011 09:24:16.57 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture b10e Medium Created desktop: Service-0x0-3eb1722$\Microsoft Office Isolated Environment
11/18/2011 09:24:16.57 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture 2brt Medium AppWorker:59168d75-7086-4318-8d12-633affa7b783 worker process is started Exe: WordServerWorker.exe Args: /id 59168d75-7086-4318-8d12-633affa7b783
/convertingService net.pipe://127.0.0.1/WordServer71cf62b9-c34c-46c4-9828-55de2d5f5ac0 /assembly WdsrvWorker.dll /type WACWS /IsBatchedTracing True /LogQuota 100 WorkerType: WorkerType1 Directory: c:\windows\system32\inetsrv, pid : 6752, IsSandBoxed: True,
UniqueSandBoxSid: S-1-5-26473-19571-45394-49
11/18/2011 09:24:16.57 w3wp.exe (0x1BC4) 0x18CC Word Automation Services
Office Viewing Architecture vioz Medium RemoveWorker isRemoved: True session id : uuid:c9cce13b-5285-47d6-a666-29da19e57c67;id=48, Guid: 89d80fff-43ec-459e-9d95-5ed8b67f20bb
11/18/2011 09:24:16.57 w3wp.exe (0x1BC4) 0x144C Word Automation Services
Office Viewing Architecture 4sig Medium ChildProcess WordServerWorker.exe is launched inside worker 59168d75-7086-4318-8d12-633affa7b783. Pid 6752
11/18/2011 09:24:16.57 w3wp.exe (0x1BC4) 0x144C Word Automation Services
Office Viewing Architecture d9hn Medium NotifyNewChildProcessInWorker has seen WordServerWorker.exe in worker 59168d75-7086-4318-8d12-633affa7b783
11/18/2011 09:24:17.10 w3wp.exe (0x1BC4) 0x1CA0 Word Automation Services
Office Viewing Architecture viou Medium ... registering worker 59168d75-7086-4318-8d12-633affa7b783
11/18/2011 09:24:17.13 w3wp.exe (0x1BC4) 0x1CA0 Word Automation Services
Office Viewing Architecture viox Medium Worker 59168d75-7086-4318-8d12-633affa7b783 is now initialized.
Thank you for your help.
Hi Jean,
Were you able to resolve this? I am coming across the exact same error on a SharePoint 2010 development machine. I don't see any other posts on the web about it. Here is the entry from my ULS logs:
Local Controller 'fc8b8704-f0f1-4e85-a69a-dc5686c27e39': Failure: <http://ip-0a6ee272/Shared%20Documents/Word/hello.docx> not uploaded to <http://ip-0a6ee272/Shared%20Documents/PDF/hello.pdf>
(65543)
Do we share any of the following configuration points? I'm trying to narrow down the potential root cause ...
MSDN subscriber EXE install media "SharePoint Server 2010 with Service Pack 1 (x64) - (English)"
SP1 slipstream patch level. No cumulative updates.
http://autospinstaller.codeplex.com/ PowerShell scripted install
SQL 2008 R2 installed on same box as SharePoint
Active Directory domain controller on same box as SharePoint
c:\Windows\System32\drivers\etc\HOSTS file 127.0.0.1 entry for both machine and domain name
Thanks in advance for the research.
I've actually tried re-installing SharePoint several times on brand new virtual machines. That did not resolve the issue. Strangely enough, the RTM version of SharePoint appears to work just fine. With all other configuration points the
same, I loaded RTM ... ran a Word Automation PowerShell script ... and received the expected PDF output. Then when I apply the SP1 patch ... it stops working and I get error 65543.
Best,
@SPJeff
Similar Messages
-
Convert list item attachment from docx to pdf using Word Automation Services
I have been trying to convert List Item attachments from docx to pdf using word automation services, it works in a normal document library but when I use the list attachment it throws a null reference error.
var settings = new ConversionJobSettings();
settings.OutputFormat = Microsoft.Office.Word.Server.Conversions.SaveFormat.PDF;
var conversion = new ConversionJob("Word Automation Services", settings);
conversion.UserToken = SPContext.Current.Site.UserToken;
var wordFile = SPContext.Current.Site.RootWeb.Url + "/" + wordForm.Url;
var pdfFile = wordFile.Replace(".docx", ".pdf");
conversion.AddFile(wordFile, pdfFile);
conversion.Start();
Using reflector I was able to see my problem lies in Microsoft.Office.Word.Server.FolderIterator.cs where it uses SPFile.Item which returns NULL
internal void CheckSingleItem(SPFile inputFile, SPFile outputFile)
Microsoft.Office.Word.Server.Log.TraceTag(0x67337931, Microsoft.Office.Word.Server.Log.Category.ObjectModel, Microsoft.Office.Word.Server.Log.Level.Verbose, "OM: FolderIterator start a single item: source='{0}'; dest='{1}'", new object[] { inputFile.Url, outputFile.Url });
Stopwatch stopwatch = Microsoft.Office.Word.Server.Log.StartPerfStopwatch();
try
this.CheckInputFile(inputFile.Item);
this.CheckOutputFile(outputFile.Url);
Is there any way to get around this?Hi Qfroth,
According to your description, my understanding is that when you use word automation service to convert Word to PDF for list item attachment, it throws the null reference error.
I suggest you can create an event receiver and convert the word to memory stream like below:
private byte[] ConvertWordToPDF(SPFile spFile, SPUserToken usrToken)
byte[] result = null;
try
using (Stream read = spFile.OpenBinaryStream())
using (MemoryStream write = new MemoryStream())
// Initialise Word Automation Service
SyncConverter sc = new SyncConverter(WORD_AUTOMATION_SERVICE);
sc.UserToken = usrToken;
sc.Settings.UpdateFields = true;
sc.Settings.OutputFormat = SaveFormat.PDF;
// Convert to PDF
ConversionItemInfo info = sc.Convert(read, write);
if (info.Succeeded)
result = write.ToArray();
catch (Exception ex)
// Do your error management here.
return result;
Here is a detailed code demo for your reference:
Word to PDF Conversion using Word Automation Service
Best Regards
Zhengyu Guo
TechNet Community Support -
I have code attached below, running inside SharePoint (in a page), used to convert .docx document to .pdf using Word Automation Services.
SPFile inputWordFile = ##CODE THAT RETRIEVE THE SPFile ##
using (Stream inputWordStream = inputWordFile.OpenBinaryStream())
using (MemoryStream outputPdfStream = new MemoryStream())
SyncConverter sc = new SyncConverter(wordAutomationServiceName);
sc.UserToken = web.CurrentUser.UserToken;
sc.Settings.UpdateFields = true;
sc.Settings.OutputFormat = SaveFormat.PDF;
ConversionItemInfo info = sc.Convert(inputWordStream, outputPdfStream);
if (info.Succeeded)
What happens is that the conversion fails. errorCode is 10.
What I came to, is that this is related to the Domain Controller being installed on the same machine.
I have examinated and excluded all several other possible issues (memory resources, etc.).
What I had undestood as far, is that the problem is that "the
converter is executed in the context of a very unprivileged local account, and there are no local accounts on DCs"
Is this a KNOWN ISSUE?
Is there a workaround for development enviroment having DC+SQL+VisualStudio+SharePoint on the same machine?Hi,
It is recommended to try the code demo in this documentation below in a Console Application to see if it can work in your environment:
http://msdn.microsoft.com/en-us/library/office/ff181518(v=office.14).aspx
If it still can’t work, you can restart the Word Automation Services in SharePoint Central Administration in case it is a service issue.
Feel free to reply with the test result if the issue still exists.
Thanks
Patrick Liang
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
[email protected]
Patrick Liang
TechNet Community Support -
Word Automation Services Changing element in the output Document - Sharepoint 2013
Hi,
We are currently running Sharpoing 2013 with Word Automation Services,
We have documents that we send to WAS for conversion, however the output of those documents have their styling, fonts and currency values changed where display of the currency gets changed to right to left.
The issue started when we had Arabic installed as a proofing language however nowhere in the document did we have Arabic set, we have since removed the language from Word, however it seems that just having the language installed has altered some element
in the document properties that causes WAS to change the document.
Please advise?Hi Faiez,
What did you mean by “having the language installed has altered some element in the document properties”?
Is there any difference when you view document directly before and after doing conversion?
For this issue, I recommend to do the steps below for narrowing down the issue scope:
Create a new document and upload it to SharePoint to do the conversion, then compare the results.
Test the Word Automation Services in another web application to see how it works.
Check if the Disable embedded fonts is set to Yes. If yes, set it to No and then check the results.
Thanks,
Victoria
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Ive just subscribed online but realised I have the wrong service by mistake... I require Convert PDF into Word doc service but selected Adobe send in error, sorry. Can you please switch the service for me? Thanks Anthony Levy
Hi Tony,
Please refer this KB document : Return, cancel, or exchange an Adobe order
Please let me know if you need any further assistance.
Regards,
Rahul -
Converting Word To Pdf using Windows Automation Services
Hi,
I tried to convert word documents to pdf using "Windows automation Services" and followed below links to create event receiver but it is not converting to pdf, then I tried to debug code but I got an error "Unable to automatically
step into the server.Unable to determine a stopping location.Verify symbols are loaded.The breakpoint has a filter conditions have not been satisfied".
http://msdn.microsoft.com/en-us/library/ff181518.aspx
http://www.zquad.in/2011/01/sharepoint-2010-convert-document-to-pdf.html
Can anybody help me to resolve this issue?
Any help would be appreciated.
Thank you,
AA.Hey
i suggest if you are using SharePoint server 2013 and you have Office Web Apps available in your farm, then this feature will be there out-of-the-box without using any code.
Ahmed Said Moussa SharePoint Consultant -
I purchased the PDF to Word export service.I got a word download of my PDF-but can't edit it
I bought the pdf to word export service but got no instructions. I was able to down load a word doc x version of my pdf from Adobe, but have no instructions on how to edit it, or how to save the document to my computer. Help please!!!.
Hi Joe,
I have some great documents that will assist you:
'Getting started' guide
FAQ
Let me know if you have further questions!
Regards, Stacy -
Convert Army Field Manual in PDF to Word
Can you convert an Army Field Manual in PDF to Word or does it fall under the "few" documents in which you are unable to do so? If so, why does your program not work?
34 megabytes is a fair size. Do you have fast broadband? That would take me over an hour to upload.
For security- sure. Open it in Adobe Reader (not a browser). Use File > Properties, then click on the Security tab. It will tell you the security method and some stuff about what is and is not allowed. Let us know what it says. -
Export PDF to word or rtf fails due to "too long or complex"
I am trying to convert a 190 pg PDF to Word or RTF. Failure message is "file is too long or complex"
Two examples:
1. concatenating the last word of every single line with the first word of the following line resulting in a very large number of "misspellings." Yeah, I could go through the entire 140 page document and fix all the misspellings, and then repeat for all 100+ documents. Yeah, ...no.
2. Splitting lines and using a different format (font type, size) on the two parts of the split line. Among other problems, this breaks chapter titles, and runs things together that shouldn't be.
This is hardly the full set, but they do fairly represent examples of where one might expect the possibility that Acrobat would get it right. Similarly, these give some feel as to the order of magnitude of the problem: 30 to 50 errors per page.
In point of fact, I don't really want it to look exactly the same. The plan is to load these into my library for indexing, linking, and the like. I want the library tool to be able to reformat on the fly with changes in window size, etc. -
How to rotate PDF with the automator?
Hello everybody!
I'd like to create a WorkFlow to rotate all the selected PDFs (one page PDF) of 90º.
In the PDFs section of the Automator there isn't anything like that.
Somebody can help me how to do it?
Thks a lot!
EnricoHello
You may use something like the following script, which will rotate pdf files on desktop by 90° CW (clock-wise) and save the rotated pdfs in ~/desktop/out directory with name with _RC90 appended; e.g. Given original name = abc.pdf, rotated pdf = abc_RC90.pdf. The ouput directory, if specified, must be present in advance. If ouput directory is not specified, rotated file is save in the same directory as the original resides in. Specify -90 or 270 to rotate 90° CCW (counter-clock-wise).
#!/bin/bash
cd ~/desktop || exit
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w <<'EOF' - 90 *.pdf out
# ARGV = angle pdf [pdf ...] [output_directory]
# * angle is measured in clock-wise and must be one of [-270, -180, -90, 90, 180, 270]
require 'osx/cocoa'
OSX.require_framework 'PDFKit'
include OSX
def usage
raise ArgumentError, "Usage: #{File.basename($0)} angle pdf [pdf ...] [output_directory]"
end
usage unless ARGV.length > 1
outdir = File.directory?(ARGV.last) ? ARGV.pop : nil
usage unless ARGV.length > 1
rota = (ARGV.shift.to_i + 360) % 360
usage unless [90, 180, 270].include? rota
ARGV.select { |f| File.file?(f) }.each do |f|
url = NSURL.fileURLWithPath(f)
doc = PDFDocument.alloc.initWithURL(url)
unless doc
$stderr.puts "Not a pdf file: %s" % [File.expand_path(f)]
next
end
(0 .. (doc.pageCount - 1)).each { |i| doc.pageAtIndex(i).setRotation(rota) }
bname = File.basename(f).sub(/\.pdf$/i, '')
odir = outdir ? outdir : File.dirname(f)
doc.writeToFile("#{odir}/#{bname}_RC#{rota}.pdf")
end
EOF
In order to make this as Automator workflow, use Run Shell Script action as follows.
shell = /bin/bash
pass input = as argument
code = as follows:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w <<'EOF' - 90 "$@"
# ARGV = angle pdf [pdf ...] [output_directory]
# * angle is measured in clock-wise and must be one of [-270, -180, -90, 90, 180, 270]
require 'osx/cocoa'
OSX.require_framework 'PDFKit'
include OSX
def usage
raise ArgumentError, "Usage: #{File.basename($0)} angle pdf [pdf ...] [output_directory]"
end
usage unless ARGV.length > 1
outdir = File.directory?(ARGV.last) ? ARGV.pop : nil
usage unless ARGV.length > 1
rota = (ARGV.shift.to_i + 360) % 360
usage unless [90, 180, 270].include? rota
ARGV.select { |f| File.file?(f) }.each do |f|
url = NSURL.fileURLWithPath(f)
doc = PDFDocument.alloc.initWithURL(url)
unless doc
$stderr.puts "Not a pdf file: %s" % [File.expand_path(f)]
next
end
(0 .. (doc.pageCount - 1)).each { |i| doc.pageAtIndex(i).setRotation(rota) }
bname = File.basename(f).sub(/\.pdf$/i, '')
odir = outdir ? outdir : File.dirname(f)
doc.writeToFile("#{odir}/#{bname}_RC#{rota}.pdf")
end
EOF
An Automator service will look something like this.
Tested under 10.6.8.
Good luck,
H -
Problems with hyperlink when converting .docx to .pdf using Word 2010
I have a Word 2010 .docx document that has a link to a web site in it. The link works fine in Word, but does not work after the conversion to PDF. I am using the Acrobat add on in Word to create the PDF.
There is a pound sign ( # ) in the Word doc hyperlink and it is being changed to a percent sign ( % ) during the conversion to PDF. Any suggestions?I will report the bug. I had read about some other problems with .docx files so I saved the .docx to .doc and then converted but I got the same results.
Thanks for the feedback. -
W7 Ent. x64 SP1, Office Prof.+ 2010 x64, Acrobat XI Pro.
Hi Rave,
No, I get the error no matter that documents I try to convert.
No, it have never worked.
I have uninstalled it and then reinstalled it again, I have updated it to 11.0.6 but it maid no difference.
Do you know how to reinstall just the PDFMaker?
Regards,
Magnus -
RoboHelp11 - Search doesn't find a PDF with word in Title
I am having challenges with some PDFs being found when you search. For example.
Using Sleep as the search word, the PDF document with a title "Sleep Apnea Guideline" should have been found. But it isn't. Many other documents and websites are found but not the one I expected.
And even when I search for Sleep Apnea, the document is not found.
The primary layout is Multiscreen HTML5.
So far I have managed to solve every problem that my client has asked to solve so that they can use RoboHelp as the method to deliver a large number of reference documents and websites. Unfortunately, this one issue my stop everything. I am not able to explain why the document cannot be found.
Am I doing something wrong?Yes, there are other PDF documents and they can be found, I made sure that PDFs are not excluded.
Even if it were a scanned document, the file name should be found. I am not sure how I can check if a document was scanned or not. I did a search for sleep while in the PDF and it found the words. Only the topic that this is in displays in the list but the actual PDF file (with sleep apnea in the name) does not list separately.
Here is what I have in the topic:
Here is the baggage file name. -
Problems converting Wrod doc (2007) to PDF with Adobe Acrobat 8.x
I have been trying to save a word document (2007) to PDF. If I open Acro
bat and try to do it there by selecting a file I get a message that says unexpected error - no details. If
i try from Word, the file appears to process but there is no document.
I see nothing on line that answers this question.
Thanks in advanceHi there,
Sorry to hear you're having trouble. While I can't help with your Acrobat question (you're not in the Acrobat forum, but rather in the Acrobat.com forum), I can tell you that there are two online services that can do this conversion for you:
1. Acrobat.com (www.acrobat.com) is a service for creating and sharing files, as well as web conferencing;
2. Adobe CreatePDF (http://createpdf.acrobat.com) is a service solely for creating PDF files from existing documents.
I would recommend either of those services to you for creating PDF files from your existing Word documents, as well as from image files and other text files (for a full list of supported documents, please see http://createpdf.acrobat.com/faq.html).
For help solving the Acrobat problem, you'll probably want to re-post your question to the forum on the Acrobat User Community site: www.acrobatusers.com/forum
Best of luck!
Rebecca -
I get an error message when I try to convert a PowerPoint program from PDF to Word.
I get an error message when I try to convert a PDF Power Point Program to word. I need to convert the PPP since I must edit the slides.
You may want to look at our CreatePDF service or Adobe Acrobat Professional. Both of these options have a PDF -> PPTX conversion option.
You can learn more about CreatePDF here: http://createpdf.acrobat.com
You can learn more about Acrobat Professional here: http://www.adobe.com/products/acrobatpro.html We do offer a trial of Adobe Acrobat Professional here: http://www.adobe.com/go/tryacrobatpro/
Maybe you are looking for
-
We're experiencing an issue with one of our Windows Server 2008R2 Standard Edition SP1 servers where an Application error occurs at least twice, and sometimes up to 5 or 6 times per day. The following error is what we see. Any help would be greatly
-
Safari won't launch, can't send crash report
hi all, i have a 2009 macbook pro running 10.5.8. for several days now safari crashes out while using it. when it does that, i have to force quit the program and relaunch. very often, the browser won't relaunch at all. if i leave it alone for a while
-
After updating to iOS 8.2 my music deleted
After my phone updated to the new iOS 8.2 the music that I had deleted from my music list the only once that are left are the once that I bought from iTunes I tried to re-upload the music again but it wont let me. Can some one help me please.
-
Document Services administration
Hello, Can someone tell me what permissions are actually granted with this "Document Services administration" . thank you RJ
-
Error when purchasing apps on iPad and iPhone
I keep getting the following error when I update my apps. http://twitter.com/adamprocter/status/179880119488352256/photo/1 Then sometimes those other apps gp greyed out - kinda stuck.