Retrieving word document in Objective-C - objective-c

I want to retrieve a word document through a web service call in Objective-C.
I have three question on this task:
How to retrieve the word document from a webservice call in Objective-C. (Inside the webservice I retrieve the document through a database call as the word document is stored in the database).
How can I store it in the sand box after retrieval ?
How to open the word document in Objective-C?

Like any other binary file: eg pdf
Save it...an example
you can open as binary and it will be hard to display properly, but I am sure there are word viewer apps, and you can open with they.

For retrieving a document I would use a networking library such as AFNetworking
Then you can store it on you app Documents folder (check this out)
The you can show your document using the Quicklook features of iOS. You may want to take a look at the Document Interaction Programming Guide

Take a look at the QuickLook.framework. That can read all MS Office formats. Also can print from a supported AirPrint printer.
https://developer.apple.com/library/ios/documentation/QuickLook/Reference/QuickLookFrameworkReference_iPhoneOS/
Example:- http://kratinmobile.com/blog/index.php/document-preview-in-ios-with-quick-look-framework/

Related

How do I reference a hosted docx rather sending every time when creating a pdf (document generation api)

I have asked this question on https://community.adobe.com/ and have not received an answer. If I do, I will include the response here.
I am able to create a pdf using the basic approach outlined by adobe at https://developer.adobe.com/document-services/docs/overview/document-generation-api/
Ideally, I don't want to have to send the base docx word document across in the api call each time I generate a new pdf. I would rather host the docx which can be retrieved at document generation time. One approach would be a reference url to a docx hosted on acrobat.adobe.com. At the moment I have to send the docx as well as the json data which seems inefficient.
I am using https://cpf-ue1.adobe.io/ops/:create
"cpf:inputs":{
"documentIn":{
"dc:format":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"cpf:location":"InputFile0"
},
I guess if it can't be done, then that's okay, I just would like to know so I can implement accordingly.
thank you

Windward Document Generation - PDF Copy Protected

In our application, we generate a few reports and documents through Windward. The documents are generated based on specific user conditions and the user is able to download the document.
As part of a new requirement, we would like to enable copy protection of the generated PDF -- basically, users would not be able to Copy the contents of the document.
Is there anyway we can achieve this through Windward? Or do we have to integrate with external third party software like LockLizard or Win2PDF?
We did think of converting the document to an image and recreating the PDF but this is unacceptable as the document formatting became off the mark.
Appreciate any insights or alternate solutions.
Thanks,
Aravind
Windward does this. If you're using the Java engine use the following calls (javadoc):
ProcessPdfAPI.setOwnerPassword()
ProcessPdfAPI.setUserPassword()
For the .NET engine use the following calls (api docs):
ReportPdf.OwnerPassword
ReportPdf.Security
ReportPdf.UserPassword
Is this what you need?

docusign PDF validation issue, is there documentation available?

We have some code which is generating a data filled PDF (fdf) file from an excel spreadsheet which is then being sent to docusign in our test environment.
Some of these work, and some come back with an error "PDF_VALIDATION_FAILED".
We have narrowed it down to the PDF document itself, and have watered down the original template to contain just four fields. We have watered down our excel spreadsheet to four basic fields using (for example) "a,1,a,2" for one input and "aa,1,a,2" as another, however one will consistently work and one will consistently fail.
Viewing the generated PDF's in a local PDF viewer (Adobe and PDF XChange Editor) the document appears fine, viewing the documents side by side in a hex/diff editor (WinMerge) shows minor differences in the streams being sent (as expected).
Is there any documentation on what validation is being performed on the PDF so we can emulate this locally and make sure our PDF's are valid before sending to the docusign API?
Thanks
Template
I am able to successfully create an envelope with the Documents you have provided.
See here for the complete CreateEnvelope request that I have used
I have used these documents that you have provided
Working PDF
Non Working PDF

How to streamline an SSRS web service call?

Using a 3rd party application (Tenfold) I currently call the SSRS web service methods to render a report as .pdf.
After I receive the encoded blob (5th parameter in the Render Method) I write the blob to the file system as a pdf using an internal WriteBinaryFile call, but in this form I cannot open it in a pdf reader. To solve this problem we write a .txt file with the path and file name of the pdf. Then send that to an external program Base64Decoder.exe which converts the file to a user friendly form that I can then open and view properly.
The Base64Decoder.exe is not 100% reliable and I'm looking for a better way to solve this problem. From what I've read from others the web service should return the blob in binary form which I then should be able to open without any conversion. Thanks in advance for any light that you can shed on this issue for me.
the render method returns a byte array, which is what you want to save to disk
there's an example here:
http://technet.microsoft.com/en-us/library/aa258532(v=sql.80).aspx

Creating a webarchive from objective-c

We are updating our email signatures in the company I work for and since the last update a lot of our employees have swithes to Mac. Allthough they have switched, few are techincal experts.
Many of our users use the Mail app in OSX. To install a HTML signature in the Mail app it quite an hassle which I would like to improve for these users.
What I want to do is to create an OSX app that uses an build in template and filles that template with the users name, job title, phone number ect.
BUT, now the "hard" part comes... how can I make a webarchive from the HTML page that is the result of the template?
And also, can I programaticly add this to Mail?
Best regards,
Paul Peelen
Creating .webarchive is easy. Use the command line tool textutil, or use WebView's method [[[webView mainFrame] dataSource] webArchive] to get it.
You can change the signatures stored in Mail.app via Applescript. See its dictionary using AppleScript Editor.app. It accepts a rich text as an argument, so you might want not the webarchive but a rich text.
You can also look at my Applescripts on Mail signatures - hints.macworld.com that a wrote a while ago.
Which may be of some help. They use Textutil to import and export Mail signatures.
Also have a look at Preferences Utilities Reference which may help you to update the SignaturesByAccount.plist in Objective C.
And the value Types section of Accessibility Roles and Attributes Reference to get an idea of the the abstract value types, and their specific C and Objective-C types. I.e NSArray = CFArrayRef. You will need those for the plist.