Hello Team,
Hello Deric,
Hello Deric,
As we understood, your scenario implies that your documents are stored in the database. And you want to allow users to print them without opening documents in the GroupDocs.Viewer widget. To be honest, this feature requirement cannot be done in straightforward way, and now we will describe you, why.
When you open a document in the GroupDocs.Viewer widget, the GroupDocs.Viewer opens it and converts to the HTML-compatible form. For image-based mode the document is converted to a set of images, where each image represents one document page. Extracted text is stored in the JSON and is placed over these page images, like overlay. In HTML-based mode the document is converted to the truly HTML-based representation. And only when the document is converted, you can see it in the browser and print. That's how GroupDocs.Viewer works, because browser cannot display PDF (without Adobe plugin), MS Word, Excel, PowerPoint and so on.
Now, what about document printing. There are two printing modes. First mode - HTML-printing, assumes that GroupDocs.Viewer prepares a special HTML-version of the document, designed for printing, and then opens a print dialog using JavaScript on client-side. This method has several flaws; in particular, different browsers distort some HTML-versions, and print version looks different from original.
In order to deliver a 100% copy of original document and to secure it from distortions, GroupDocs.Viewer contains a PDF-printing mode. In this mode a PDF-copy of original document is created, and then this PDF file can be printed from the browser (if browser supports PDF-printing) or from any other software. We usually suggest this printing mode for our users as more reliable and safe.
Now you can understand why it is impossible to prepare a printing without any document processing. Which solutions we can suggest for you?
First of all, GroupDocs.Viewer contains a "DocumentCache" class, which pre-generates document cache (document cache is a ready-to-use HTML-compatible version of the original document) without opening a document. It can generate image-based or HTML-based cache. We can develop a special method, which returns a PDF-version of the specified document. In fact, it can be a usual C# method, which obtains document and returns its PDF-version, which can be sent to the client-side and then printed.
If you are interested in HTML-printing mode, this also is related to the cache generation. However in this case we need to develop a mechanism, which returns a special print-version based on existent cache.
Now, when you understand how GroupDocs.Viewer works with documents and printing and how your requirement can be theoretically solved in future releases, we are waiting for your feedback. Which printing mode you want to use? What specific scenario you tries to reach?
Best regards.
Hello Pavel,
Hi Deric,
Hello Pavel,
Thank you for further clarifications. PDF-printing mode allows printing through certain browsers only, that is why we would choose HTML-version.
Hi Deric,