PDF Previewing and viewing - asp.net-mvc

I'm creating a document viewing web application. You log in and it takes you to a screen where you have all your docs listed on the left. I want to make it so that when you roll over a document a preview of the document shows up on the right. From there you can click on it for a full view and printing capabilities. I'm not asking how to do all that but I'm wondering what the best way would be to go about rendering the preview of the document. The documents are all going to be pdfs and stored on a server. I'm working in asp.net 3.5 mvc in visual studios 2008.

For creating the PDF preview, first have a look at some other discussions on the subject on StackOverflow:
How can I take preview of documents?
Get a preview jpeg of a pdf on windows?
If these don't answer your question, you can try a couple more things:
You can get a commercial renderer (PDFViewForNet, PDFRasterizer.NET, ABCPDF, ActivePDF, ...).
Most are fairly expensive though, especially if all you care about is making thumbnails.
There is a CodeProject article that shows how to use the Adobe ActiveX, but it may be out of date, easily broken by new releases and its legality is murky.
Install GhostScript on the server and request rendered thumbnails of any page from it.
I did a small project that you will find on the Developer Express forums as an attachment.
Be careful of the license requirements for GhostScript through.
I use it for an internal software and it's working pretty well.
Hope this helps.

Here
I render the jpeg thumbnails of the first page of the pdf document when a file is uploaded.
When the user clicks he can download the document (or open them direcly in the browser) to read and print them.
Update: to create the thumbnails I used a .net component called PDFView4NET from O2Solutions

Related

Rendering PDF in iOS

Need help on rendering PDF using CGPDFContext. I am currently using UIWebView to display PDF but would like to perform much more operation rather than just reading like Highlight Text, Search PDF, Annotate PDF. Not looking for using any Framework or library.
Any help will be beneficial. For a start, code on how to render PDF using CGPDF and displaying it instead of using UIWebView.
PDF annotations are a rabbit hole. I've been working on them since 2010. The spec is thousands of pages. It's easy to get started but it takes forever to get right with all the PDFs and variations out there. Even a simple feature like bookmarks are harder than you would think.
To date there's no open source framework that implements PDF annotations. The above linked one can be a good starting point. If you don't have months/years to build something on your own, there are a few commercial options available - like PSPDFKit, available for iOS, Android and Web, which I am building.
We have a guide article listing the most important PDF spec documents.
Searching is another tricky topic. It's quite hard to convert the PDF text data to unicode. The Adobe CIDFont spec is a good starting point.
You shoud try VFReader, it is an open source project for rendering PDF files on iOS. It can be a good starting point.

How to export interactive PDF for iOs?

I have an interactive PDF, a catalog, where you have to click on a image to go to a specific page. All images are converted in buttons with the option "Go to destination". On Windows and Mac it works perfectly. But on iPad all the links, all the images, are not showing.
I've already read on many forums about this common problem between iOs and interactive PDF's. But I have some old PDF's, with the same principle, and those are working great on iPad. The images are showed, the links works...
That's why I'm wondering if it's not my fault or maybe I export the PDF in a wrong way.
The links to the PDF's.
m.hconline.eu/Baby%20Catalogue.pdf
m.hconline.eu/LA Catalog 2013.pdf
"Buttons" are not compatible with most pdf readers (except Acrobat reader and a few others). Such buttons are not recognized on the standard pdf reader on the iPad. I have checked the old file on the iPad, it does not work as well.
What you need to do is to use regular pdf links instead of buttons. In order to do so, you can use Acrobat Pro, delete your buttons, and create new links using the chain icon. You can specify the area of the link, so the user experience will be the same.
This is an old issue, but I did find more information regarding this. (I'd add a comment to the accepted answer, but alas, i do not have 50 points.)
According to George Johnson, "The problem with InDesign is in using the Go To Next/Previous Page options in InDesign[buttons], it creates an Execute a Menu Item action when exported to PDF, and since Reader for iOS doesn’t have menu items or interprets such actions otherwise, they are just ignored." - https://forums.adobe.com/thread/1142056?tstart=0
As for work arounds, I found a tutorial by Steve Werner, outlining the method of changing your work flow around, and adding your buttons in Adobe Acrobat instead, as kind of a post production linking process. - http://indesignsecrets.com/navigation-button-tricks-for-interactive-pdf-on-an-ipad.php

Opening a TIFF File from the Web Browser

I checked previous questions here on SO but I think I want my functionality to work a little different. I understand that .tif files are not natively supported in Internet Explorer and that an extension, such as AlternaTIFF, are available to remedy this. However, I would like the dialog to show up where the user can either save/open the file on the client side. I know that MS Windows Picture and Fax Viewer can open them, no problems.
The files are located on our servers and this will be an intranet site. Currently, I have a link to the files populate in the view but again, I'd like that option for the user to Save/Open the file.
I'm using MVC, which I'm a little unfamiliar with, and can't seem to figure this one out. Thank you.
You can do an action that returns a tiff by changing the headers so when someone clicks the link the file will get downloaded or using FileResult.
Example with FileResult (i find it easier): http://www.dotnetcurry.com/ShowArticle.aspx?ID=807
For saving them is just like uploading any file with MVC. This post can be useful http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
My advice is that you convert them to .jpg or .png when uploaded using GDI+.
//You first upload the tiff to the server like the post above explains
//And then open and convert it to .JPEG
Bitmap bm = Bitmap.FromFile("mypic.tiff");
bm.Save("mypic.jpg",ImageFormat.JPEG);
And if you already have the urls of all the tiffs, you can always do a console app to convert all of them. Even if you need to use tiffs its a good idea to have .jpg versions to show on the web. You can even resize them to create previews and save some bandwith too! :-)

PDF generation in XCode

I am a newbie in iPhone development. I am planning to do a PDF application for iPhone. The functionality is:
User will type their input in a text field (which is going to be the content of the PDF file).
I have to modify the PDF file through code while saving (paragraphs, tables, bullets etc).
User can save it in their own name.
User can send the PDF file as attachment of MFMailComposer.
So I have searched and got many links. However I didn't find any leading details to create and modify a PDF file in iPhone/iPad.
Can anyone please provide me a good reference to do this. Are there any alternatives to do this?
I've used this reference: https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
It contains theoretical explanations and source code examples
Please use the below link to download sample apps for PDF Reader/Viewer in iOS
PDF Reader/Viewer in iOS
Also please look at detail about pdf creation, manipulation etc in below links
developer.apple: PDF Document Creation, Viewing, and Transforming
Fast-and-lean-pdf-viewer-for-iphone
If you were doing a Phonegap app I'd say got for jsPDF, which would enable you to create (basic) PDF files in Javascript. I don't do Obj-C, but a quick look on SO provides good links.

How to retrieve the file previews used by windows explorer in Windows vista and seven?

I am developing a Delphi documents management application, so somehow I am giving the user some functionality similar to windows explorer.
I would like to know if there is a way to get the preview used by windows explorer. For example windows explorer creates a small thumbnail for a pdf document for example, and displays it when the user chooses to view "big icons". Is there a way to retrieve that preview?
MyTImage := GiveMePreviewForFile('C:\Test\File.pdf');
#user193655, using the IExtractImage interface is the way to go, this interface exposes methods that request a thumbnail image from a Shell folder
you can find a very complete sample in this site and the source code is here.
check this image
Take a look at the docs for IExtractImage. Basically you use IShellFolder with IExtractImage to get the picture you are looking for.

Resources