I have a quiz website, where user will select the topic and can read contents.
So I have contents in various formats like video, textfile, pdf reports.
For contents to show them in box I am using http://viewerjs.org/.
since it supports limited extensions and doesn't fill up my all requirements for file type- .docx,.doc, .xlsx,.pptx.
Is there any open source box viewer that supports office document?
Although I can read their contents through c# and display them back as plain text but my primarily requirement is to show them in box as viewer.js does it for pdf.
I think you are conflating http://viewerjs.org/ with the Box View API, which has an open-source viewer component that is also called viewer.js.
The View API will convert Office file formats as well as .pdf.
The View API does not have a C# SDK available yet (as far as I know), but there are a bunch of open source ones in other languages.
Related
MS Graph provides various link types (weburl, sharelinks, preview link, etc) however I am struggling to get the correct link for what I am looking for. If you log into OneDrive UI and you right click on a file and click preview. It takes you to a page that is kind of a in between for the Office 365 online word editor or the Adobe Cloud PDF editor. It has a toolbar up top that lets you choose to open a file in the browser or in the appropriate editor they offer. I cannot seem to find where this link is produced in MS Graph API. The closest I get is the CreateLink() which produces a link with this toolbar and editor choice for PDFs but for docx files that link takes you directly into the file so there is no in between. I prefer consistency so this in between page for all document types is perfect.
Is there anyway to get this link correctly and not some workaround like shareable links since my users already have access to the shared folder these files sit in?
Is there a way (some specific COM object) which can be integrated into your app window and render the content of .MSG file? There are solutions for parsing .MSG files but I'd like to easily display it. Emails with tables, links and especially images are very tricky to render correctly - as I understand, only Outlook is able to render is accurately in a shape user is accustomed to.
Even Preview Handler cripples email formatting - you can notice it in Windows Explorer's Preview Pane. I guess the only reliable solution is to ask Outlook to render it for you...
You may consider automating Outlook to display the .msg files. See How to automate Outlook and Word by using Visual C# .NET to create a pre-populated e-mail message that can be edited for more information.
Also you may consider using third-party components for getting the job done.
I have a PDFthat has text boxes in it. My program uses Xfinium PDF software to fill the text boxes. When I view the filled in PDF the document shows up with no data in the fields. I have tried using QLPreviewController and UIWebView and they both do not display the filled in fields; however, if I email the document to myself and open it in Adobe DC on the iPad all the data shows up correctly. It may be important to note that even the mail app does not show the PDF correctly filled in.
Here is the PDF opened in Adobe on iPad
Here is the PDF opened in UIWebView in my app (also shows same way in QLPreviewController
PDF forms may bring along appearances or may rely on the viewer to create an appearance for the value of the field.
Fairly complete PDF viewers (like Adobe Reader or Foxit) can get along with both variants well. Incomplete viewers, though, like many so called previewers, require an existing appearance and display empty documents for forms which do not bring along appearances.
Thus, if you want your forms to be visible on incomplete viewers, too, provide appearances.
The QLPreviewController use the CGPDF* API to display the PDF files. The CGPDF* API has some limitations, it displays only the page content and it does not display annotations, no matter if they have appearances or not. Form fields use widget annotations to display the field content so they are also not displayed.
The solution here is to flatten the form fields. This operation will transform the form fields into page content and QLPreviewController will display the final file correctly. The downside of this operation is that the form fields are no longer editable.
The XFINIUM.PDF library creates apearance objects for field values. The problem is related to iOS PDF rendering engine which does not display annotations and form fields. The solution is to flatten the form fields if you want to view the files using the QLPreviewController.
The form fields are flattened with this line of code:
pdfDocumentObject.Form.FlattenFormFields();
Disclaimer: I work for the company that develops the XFINIUM.PDF library.
Both QuickLook and UIWebView/WKWebView uses Apple's internal and undocumented CorePDF framework, which has no code that would render PDF AcroForms (doesn't matter if backed by appearance streams or not)
You can either
1) Flatten the document on the server or with a client-side library.
2) Re-implement everything from scratch and add support for PDF forms. (See Page 431ff in Adobe's PDF Specifications - "Interactive Form Dictionary")
We did (2) in the commercially available PSPDFKit SDK. It doesn't use Apple's rendering engine as you do not have a way here to render appearance streams for PDF form widgets, so even with a lot of code you'll not be able to get the representation that is encoded in the document. For this you'll either have to result to private API or re-implement everything yourself. We also support (1) using the PSPDFProcessor class.
Thanks,
It works for me.
pdfDocumentObject.Form.FlattenFormFields();
Bala.
I am developing a C# WinForms application, and I would like to be able to "preview" various document types within it. That is, when a user selects a filename from a list, it shows below, within the same form, a preview of the selected file. It's a lot like they way Outlook allows you to preview a selected message without double-clicking.
Is there any way to take just a filename and create a control dynamically within my WinForms application that shows the contents of that file?
If you want to provide a preview/readonly version of the file types, an idea might be to implement PDF viewing first, this primarily involves converting PDF pages to images and then creating a view for those. Once you have that done (using GhostScript or other commercial components) you can then work on converting other formats to PDF, and use the PDF viewing option, you can probably do most office documents through word automation and text based files could be displayed directly (possibly using a rich text editor for formatted text)
HTH
Suppose in .NET (don't care what language) I want to show a user a PDF, Word and Excel file together. I am trying to replicate a document process where a user might have a PDF file and he would like to attach a WORD file and an Excel file let's say to make a stack of documents (that I would save in some directory). Then he would like to click on a button and see a stack of these documents in 1 application of some sort.
How can I display the stack of documents WITHOUT first opening WORD, then openinig EXCEL and then openining ADOBE ACROBAT - this would be really annoying for the user. I would like one unified application or some idea to mimic one in .NET that can just show all 3 documents as if they were printed one after the other on paper. (I hope I am explaining this clearly)
The only thing I can think of to do this would be to leverage some sort of PDF conversion process to create one PDF file containing all three of these documents in "printed" (page-by-page) form, and then show that. The one application I can think of that could show all of these files is a web browser with appropriate Office and Acrobat viewer plugins, and you might find it difficult to leverage that, as browser preference and other user OS settings can cause various strategies for application launching to fail.
I would convert the documents in PDF and develop a pdf viewer inside your application.
I would use a ready made library for that, don't reinvent the wheel.
For example: http://www.quickpdflibrary.com/products/quickpdf/index.php