How to use AJAX File Browser for editing PDF files - webdav

AJAX File Browser works great with Microsoft Office documents. However, I do note that the same does not work well with PDFs.
Currently in our application, 95% of the documents being reviewed/edited are PDFs. So is there a way I can make the PDFs work with Ajax File Browser?
Basically I'm looking at a solution/product which will help us with editing the PDFs using Adobe reader/professional and storing them directly on the server.

The only way to open the the PDF document is using Java applet (or potentially other method with unrestricted access to local file system). The Ajax File Browser is provided with Java applet which mount mounts local file system and opens document for editing. The Java applet automatically engaged for non-MS Office documents or if MS Office is not found. This works on Windows, OS X and Linux.
You can find info about when the Java applet is engaged here: http://www.webdavsystem.com/ajax/programming/opening_ms_office_docs

Related

Windows blocking .XLS files downloaded from the Internet where the contents are HTML

We have a legacy ASP.NET application that allows users to export the contents of a GridView control to Excel. This was achieved using this technique.
Recently, users have complained that they are unable to open their downloaded files in Excel. I tried it myself and discovered that Windows was blocking the downloaded file, preventing Excel from opening it.
It looks like Windows now regards XLS files that have been created from web page content as suspect. Is this the result of a recent Windows update? And is this technique of creating Excel files from web pages not recommended?
Correct, recent updates have broken this behavior (thanks to Nikki9696 for the article).
There are three workarounds listed:
Stop using HTML files masquerading as XLS
Unblock access to individual files (client side solution)
or add the source of the files to the Trusted Locations list in Excel (client side solution)
The best thing to do is #1. You should not be serving files with one data type as another file type. It's always generated a warning for users. Many Office clients that otherwise know how to open XLS files (such as Office for iPad) will choke when presented with an HTML file masquerading as XLS.
Instead, use a library to generate a modern XLSX file (which can be opened by Office 2003 and newer). There are several solutions such as EPPlus, NPOI, and Open XML SDK.
In the future, be careful to use supported solutions rather than cobbling together a hack like serving a file with the wrong extension.

Open source online document editor

Can somebody tell me some open source projects that implement document management online?
I need to upload document (pdf, docx,fb2), convert it to doc and allow user to edit it online and then convert back to pdf.
Images and formatting should be preserved.
I found teamlab, but it is not free and also I don't need collaborative editing.
Thank you.
It depends what your requirements are when you say 'online editing'.
You could use Nuxeo including the Nuxeo Drive extension, to enable users to edit the files from the remote repository locally (transparent in the sense the user does not take the step of downloading or uploading files), and their changes are then synced to the repository.
The user can edit the .doc file locally using OpenOffice (or MS Word if they have it).
If the requirement is strictly 'online/web only', you could convert the PDF to RTF via an OCR engine such as Tesseract, and then use one of the many WYSIWG inline editors, and connect this to Nuxeo as an edit button using their extension framework. There is an existing tesseract-ocr extension available at the Nuxeo source repo.

Loading/Saving Word Documents from Web App (asp.net MVC)

I'm making a web app. Part of it includes the automatic generation of word documents (letters). Those documents need to be opened by the end user, then saved back to the server once they've finished editing.
I tried using webdav for this but the only browser I could actually launch word from (using active-x) was IE. I also found a plugin for firefox, but for Chrome I couldn't find a way that worked.
Next I thought about making the clients map a drive to webdav (or similar), then offering up the files as file://... links, but that only works if the webpage is on the local machine.
Before I resort to ditching word (the clients won't like this) and using CKEditor or TinyMCE, is there another way?
In short, I'd like to have links to a document on the page, which when clicked are opened in word, but the file should stay remote - and then when saving, it's the remote file that gets updated.
I've also looked at Zoho but it could be very expensive for this project, plus I don't think it can be white-labelled and also looks a bit old fashioned, UI wise.
Maybe Sharepoint can do what I need? Haven't looked at that much. Also thought of making a client app to run in the system tray and deal with things.
If there was a decent way of editing Word docs from within the browser with something like CKEditor/TinyMCE and once finished, conversion back to Word format actually worked 100%, that would suffice.
I'm open to totally fresh ideas if anyone has any...
Currently Chrome, Firefox and Safari support MS Office plugin. They can open and save documents directly to server. I have tested this with MS Office 2007 and MS Office 2007 just about a month ago.
Ideally, your users would be able to use Word natively. Is there any chance you could create an Office Add-In that hooks into the BeforeDocumentSave event, looks for some indicator that the file is associated with your application, and save the updated file to your server?
Saving to the server via the Word Add-In would probably need to include some unique identifier (in addition to file name), so you could overwrite the previous version server-side. Then, if you were using something like SignalR, you could trigger a refresh on the web page when the file was saved successfully (assuming they were still on that web page) on the server (via FileSystemWatcher).
Had same problem myself.
I solved it by setting up a webdav share on the server with digest authentication (SabreDAV), and tied it into the users table on my app backend.
In relation to the client end, I solved accessing this by creating a small java applet which uses the java Desktop class (getDesktop().open()) to open the file. You will need to make sure the path is handled right for the client machine type (Windows, OS X or Linux)
You will also need to get your end users to permanently mount or map the webdav share locally.

Is there a program that lets me edit web files with a native editor?

Before I attempt to program the following function myself, I wonder if something already exists.
What I would like to do is click an edit link on my website for a given document, and have that document launch in the native editor on my local machine (via a temporary file mechanism).
When I save the document in the native editor, the document is HTTP PUT back to the website. This can be accomplished by watching the file for writes, or watching the editor process for exit.
This way I can more easily edit documents on the web (instead of going through the download / edit / upload cycle).
My design would work as follows:
Register .webedit files on the local machine.
When a .webedit file is downloaded, launch webedit.exe with the file.
The file contains a URL (http://server/document) which is checked against a security database to ensure we're only opening allowed URLs.
The URL is downloaded to a temporary location.
The temporary file is launched in the native editor.
The file is watched for changes, and uploaded (HTTP PUT) on change detection (or when the editor is closed, if it's not a single-instance multiple-document editor).
Lots of FTP / SCP GUIs have this type of functionality, but I have not been able to find it for the web in general, or a shared library that allows you to plug in to this function.
Has anyone seen a program that does this?
SharePoint works like this.
It's great for managing shared documents in corporate environments.
Users can even checkout/checkin documents & the features are very extensible..you can customize pretty much anything if you know how.
Edit:
Since you're on Linux..i've heard that Alfreco is a great alternative.
I've never used it, but I know a couple organizations using it instead of SharePoint.
It integrates with Microsoft Office as well.
Also, it will definitely be cheaper.

Run a Virus Scan While Uploading files in ASP.NET

I have developed a web based application in ASP.NET and C# where users have the facility to upload files on the server through this application I want the application to Scan the uploaded files for viruses before saving on the server. Same like when we attach files with our email in Yahoo. Please guide me how I can achieve this functionality Any API which can be integrated in ASP.NET application or any other way you can suggest. We can purchase the licensed version of a product which can achieve this. I have googled but did not find specific results.
Thanks in advance!
First of all the file must be saved onto the server before you can scan it. If you notice Yahoo will upload the file first - but not allow the attachment to be sent until scanned.
Then you can use an antivirus with a command line interface or some other kind of API. Both of these can be called via C# and should provide the functionality you require. Parhaps write a wrapper class that takes a file and returns true or false depending on whether a virus was detected.
Other applications that provide you with a command line interface:
Microsoft Security Essentials
clamAv
I believe MS AV provides better results.
Just purchase antivirus software that has a command-line interface (several popular packages include this). Once the file has been uploaded, run the scan.
I would think, in order to upload and scan at the same time, you might need to implement your own antivirus software as I'm not familiar with any package that would provide that sort of interface.
I run a shareware site. It doesn't work as you described, but I download each file to my local computer and run a scan on them. You would be doing something similar.

Resources