Display Invoice via HTML rathen than PDF? - html

I'm using Prawn to generate invoices as PDFs on the fly, which open in Adobe Acrobat. Is there a quick way to have that same invoice display as HTML, or at least be viewable from within my web app while retaining the layout, rather than opening up a new window/PDF? I've been unable to find any good example or suggestions. Thanks for your time and assistance.

use send_data in your controller action to open required files in the browser.
Check out the following SO question for more info

Related

Saving static HTML page generated with ReactJS

Background:
I need to allow users to create web pages for various products, with each page having a standard overall appearance. So basically, I will have a template, and based on the input data I need the HTML page to be generated for each product. The input data will be submitted via a web form, following which the data should be merged with the template to produce the output.
I initially considered using a pure templating approach such as Nunjucks, but moved to ReactJS as I have prior experience with the latter.
Problem:
Once I display the output page (by adding the user input to the template file with placeholders), I am getting the desired output page displayed in the browser. But how can I now obtain the HTML code for this specific page?
When I tried to view the source code of the page, I see the contents of 'public/index.html' stating:
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expectedly, the same happens when I try to save (Save As...) the html page via the browser. I understand why the above happens.
But I cannot find a solution to my requirement. Can anyone tell me how I can download/save the static source code for the output page displayed on the browser.
I have read possible solutions such as installing 'React/Redux Development Extension' etc... but these would not work as a solution for external users (who cannot be expected to install these extensions to use my tool). I need a way to do this on production environment.
p.s. Having read the "background" info of my task, do let me know if you can think of any better ways of approaching this.
Edit note:
My app is currently actually just a single page, that accepts user data via a form and displays the output (in a full screen dialog). I don't wish to have these output pages 'published' on the website, and these are simply to be saved/downloaded for internal use. So simply being able to get the "source code" for the dislayed view/page on the browser and saving this to a file would solve my problem. But I am not sure if there is a way to do this?
Its recommended that you use a well-known site generator such as Gatsby or Next for your static sites since "npx create-react-app my-app" is for single page apps.
(ref: https://reactjs.org/docs/create-a-new-react-app.html#recommended-toolchains)
If I'm understanding correctly, you need to generate a new page link for each user. Each of your users will have their own link (http/https) to share with their users.
For example, a scheduling tool will need each user to create their own "booking page", which is a generated link (could be on your domain --> www.yourdomain.com/bookinguser1).
You'll need user profiles to store each user's custom page, a database, and such. If you're not comfortable, I'll use something like an e-commerce tool that will do it for you.
You can turn on the debugger (f12) and go to "Elements"
Then right-click on the HTML tag and press edit as HTML
And then copy everything (ctrl + a)

How can I embed HTML file in excel?

I am working on a project which requires me to add a chart store in HTML file into excel. The MS web browser Active X control does not allow me to add a web browser. If I do that using VBA, it gives me some error related to not displaying Active Content. Please provide me some assistance on this. I have used IE object in VBA, but it opens the HTML file in IE.
The best way to do this would be to take the Microsoft web browser app and insert it into excel cells. This will allow you to insert the HTML.
Please note excel is not made to handle HTML and as such you won't be able to go in-depth with you HTML. Rather use different programs like MT Blocks to get the desired result.
https://www.mrexcel.com/board/threads/html-into-excel.387722/

Angular Html + Css = PDF , problem to generate a proper PDF

I'm developing a web application using .Net core 3.0 (Back-end) and Angular 8 (Front-end).
The user completes a form and then I have to generate a PDF (with design & picture) with the data that he put. The PDF needs to be in high quality.
I have tried several libraries in both Front-end & Back-end.
I need to use a free library.
I think it will be easier and better to do it in the Front-end because the user will need to print it (directly most of the time).
And also, in case of high traffic generate it from the back-end will use too many resources.
Also, "print" the html page is not an option.
I've tried :
PdfMake,
kendo-angular-pdf-export,
Jspdf,
wkhtml,
and others...
The best ones:
Kendo UI
It was really the best one, easy to implement and doing exactly what I needed. But is not free and one license is like 900e/user
pdfMake
The problem with that was that I will have to do all the design with the library-style, So I will have some limitations.
I would like to be able to generate a pdf from an HTML page including the CSS.
I'm blocked with that pdf generation.
Did someone succeed to generate a proper pdf with a good design with pdfMake?
Thanks a lot in advance.
A solution I've used is to create a service which, on the back end, generates the HTML and uses headless Chrome to render the PDF. Stream that back to the client browser.

Fill form pdf with flex

I'd like to fill a pdf form with flex.
Data are on my air application and I want to use those to fill a pdf file store on my computer.
Do you have an idea to do that?
thanks
For PDF generation I've used AlivePDF. It works well once you figure it out.
Have you tried AlivePDF with the alivepdf-template extension (they're both available on Google Code)?
Here's a sample of how to use the extension: http://gonzalo.huerta.cl/?p=3

How to create readonly viewer for Word, Excel and PDF-documents?

We need to set up a page to make some highly confidential documents (PDF, Excel, Word) available for viewing only.
The page/documents needs to be as secure as possible (no save, no print etc). We recon that we can't stop print-screen, but hopefully we can limit most of the other options.
How do you best do this? I have currently only two options that I am considering:
Open the documents inside an IFrame and experiment with javascript and css
Create a viewer in Silverlight (or Flash)
If any of you have some ideas on how to achieve this, please tell me. It will be much appreciated!
Word and Excel don't offer a lot of security. I would convert everything you want secured into a PDF and use something like the PDF viewer referenced in this question: Flash document viewer. It's an open source plugin that will allow you to disable save and print and should go a long way towards deterring users from attempting to copy the documents.

Categories