I am trying to add "print file" button to a dynamically created pdf file. I am not even sure whether its possible or where to start.
EDIT:
I have this one solution using Javascript from this link. But some PDF Readers dont allow Javascript by default.
Related
I'm currently implementing an Angular/java webpage to work with different forms for the users.
right now if the users want to edit the pdf, the only way is to download the PDF and go to the downloads folder and open it in Adobe acrobat. Which is not an optimal solution.
Is there any way I can create a button in HTML/Angular webpage that can automate this process to open the PDF in Adobe acrobat? instead of downloading and going to download folder and open it from there?
I tried to use ngx-extended-pdf-viewer to edit the pdf in the browser. But the user needs to highlight, stamp, and email features that are in Acrobat. Does anyone have a solution for this?
thanks
You can display the pdf file in new tab by the line:
window.open(fileUrl, '_blank');
The fileUrl is a variable that contains the file path. You can fetch it after the download is complete.
I'm trying to automate a process that's currently manual.
So far, I have an Excel template with macros that does some formatting and then prompts the user to save the PDF with a file name already filled in. They just have to click the save button.
I also have a Java program that monitors a folder and as soon as the Excel file gets dropped, it opens the file.
What I'm not sure about is, how do I use Java to click Excel's "save" button?
I know Java can save an Excel file as PDF without opening it, but I want the macros to run before it saves.
Why don't you just use VBA to save the file? Is the macro written in vba? Why do you require user input to save?
expression.Save
expression A variable that represents a Workbook object.
https://learn.microsoft.com/en-us/office/vba/api/Excel.Workbook.Save
I have a form with 100's of fields along with radio and check-box. What will be the best way to create PDF from it. Here is the link to my form 'http://182.71.22.42/ccs/'. I have used 'JSPDF' library but it just prints text only in PDF not any input field. I have also tried 'TCPDF' but I don't know how to show check-box and radio buttons and also I have to do css for 'TCPDF' also. Because TCPDF does not pick any HTML form css..
Please help me with this. Thanks in advance.
I like pdftk (PDF Tool Kit). It's fairly easy to use. There is a GUI, but there's also a command line tool -- which is obviously what you'll want to use. You'll install the pdftk program on your server, and run it from your PHP script.
PDFTK General Tutorial
Firstly, a blank PDF file should reside on your server. The empty fields should be labeled such that you can reference them.
When a user inputs information via your form, the data should be sanitized and inserted into an FDF (Forms Document File).
Once you have your FDF completed, in your PHP script, run:
exec('pdftk blank.pdf fill_form new.fdf output finished.pdf');
Where blank.pdf is the empty PDF, new.fdf is the FDF you just created, and finished.pdf is the name of the file you want pdftk to create for you.
Thanks for your replies .I found solution in TCPDF to show checkboxes. Just use different images, one for checked checkbox and other for unchecked
I have a JSF Web application, and at some point i present the client a big chunk of information, I want to have a save as link, that allows the client to save this information on his computer as a .txt file.
Information on how to achieve this or a good tutorial would be great.
Does this work for you? You probably would need to set the ContentType to "application/octet-stream", otherwise the client's browser will display your text file instead of offering the option to "Save as".
I believe your best bet may be to have that link actually generate an Ajax call to generate the text file and set it as the src attribute of an iframe on the page. That will trigger (I think) the file download box.
I want to like after click a JButton will directly pop out a printer window to print the pdf file no need to show the file, is it possible?
Multiple ways to do it ,
You can get access to printers installed, this requires how the printers are configured etc and then you require some print plugin to write it to pdf file.
Else you can use plenty of java pdf libraries available to do the pdf creation part too
See Desktop.print(File).