I am writing to a pdf from a java servlet, and I was wondering if the size of the pdf fields are able to be resized based on the information that is dynamically received. Here is my pdf:
This is to verify that [first_middle_last_name] is entered into......
So when I originally made the pdf I surrounded that space with tons of spaces to be able to handle large names, but now when i get a small name it just looks bad. So is there anyway to counter this?
This doesnt seem like a programming question, but the data is written from a java servlet, and I figured there might be a way to do this in the code. Thanks in advance.
Related
I am making a java program where I input answers for a friendship survey. It spits out the student's top ten friends. However I need to print out the results and give them to the students. The old of doing it was to have the java program write to write html then we would open each file one at a time and print out the page. However, having 400+ students to do it for takes a while.
So since I am re making the program I would like to make it so I can just have it on word files and print them all out at once. However, I don't know how to write to a word file and notepad isn't stylish enough. Anyone know how to make this possible or another way that is easier?
I did a similar thing some years ago, using Rich Text Format. Its advantage is that it's a plain text format that can easily be manipulated.
I created the form document in Word with some unique placeholder strings where I'd later fill in the actual data and saved it as RTF.
With a text editor, I made sure that Word didn't split the placeholders by inserting some junk formatting directives, and corrected that manually where necessary.
Then, filling in the actual data just meant to do some simple text replacement (in my case, there was no risk to interfere with the formatting directives), and saving the resulting RTF file.
As Word typically opens RTF files just as easy as DOC or DOCX ones, this was an easy working solution for me.
I'm looking for a free option to fill a XFA PDF form. I know that iText is an option but their commercial prices are too expensive for me, I'd prefer something fully open-source. There is PDFBox but it doesn't seem to allow for inserting data into XFA forms, or at least there's very little explaining how to.
I simply need to fill in certain fields in my form with certain data in a text file. Can you recommend or direct me to a solution? Thank you greatly
XFA is an enterprise product, with enterprise pricing…
XFA consists of an XML part and a PDF part which represents kind of what is in the XML part.
You may try to fill data into the XML part, and then see whether Acrobat/Reader can render it properly. No guarantee that it works, but worth a try. If that does work, you'd have shifted the problem to something maybe a bit more managable.
I want to do some type of mail designing by entering spaces so that all data shown in it is shown like if it was an HTML table, so it would show like an HTML table although without borders, but java mail seems to ignore when there are several spaces together and reduces them all to just one. I've tried to write an space in HTML code and I've also tested with entering \t so it would make a similar function, but it doesn't help.
I wouldn't like to do this in HTML code as email servers use to give problems when receiving this type of code, I'd better do it on plain text.
Any idea?
I'm creating a Web-based label printing system. For every label, there should be a unique s/n. So when a user decided to create 1000 labels (with the same data), all of it should have unique s/n, therefore the pdf will have 1000 pages, which increases the file size.
My problem is when the user decided to create more copies, the file size will get bigger.
Is there any way that I can reduce the file size of the pdf using Itext? Or is there any way that I can generated the pdf and output it in the browser without saving it neither to server/client's HDD?
Thanks for the help!
On approach is to compress the file. It should be highly compressible.
(I imagine that you should be able to generate the PDF on the server side without writing it to disc, though you could use a lot of memory / Java heap in the process. I don't think it is possible to deliver a PDF to the browser without the file going to the client PC's hard drive in some form.)
If everything except the s/n is the same for the thousands of labels, you only have to add the equal things one time as a template and put the s/n text on top of it.
Take a look at PDFTemplate in itext. If I recall correctly that creates and XObject for the recurring drawing/label/image.... and it is exactly the same object every time you use it.
Even with thousands of labels, the only thing that grows your document size is the s/n (and every page) but the graphics or text of the 'label' is only added once. That should reduce your file size.
I am working on a project here that ingests internal resumes from people at my company, strips out the skills and relevant content from them and stores it in a database. This was all done using docx4j and Grails. This required the resumes to first be submitted via a template that formatted everything just right so that the ingest tool knew what to look for to strip the data.
The 2nd portion of this, is what if we want to get out a "reduced" resume from the database. In other words, I want to search the uploaded content I now have, and only print out new resumes for people who have Java programming experience lets say. So I can go into my database, find the people who originally had java as a skill, and output a new set of resumes that are also still in a nice templated format, and only have the relevant info in them, instead of ALL the content.
I have been writing some software to do this in Java that will basically use a docx template, overwriting the items in customXML which are bound to the content controls in the doc, so the new data shows up and can eb saved as a new docx with that custom data.
This seems really cumbersome to me, and has some limitations. For one, lets say my template has a place for 3 Skills, and the particular person has 8 skills. There seems to be no good way to add those 5 additional skills to the docx other than painstakingly inserting the data with all of the formatting XML tags and such. This is a real pain, because if the template changes, I dont want to have to go back into my software and edit source code to change that additional data input XML tag to bold instead of italic.
I was doing some reading up on using Infopath to create a form that I could use to get the input, connecting to some sharepoint data source or something to store the stripped out data. However, I can't seem to find out if it is possible using sharepoint to get the data back out, in a nice formatted way. What would the general steps for this be? It seems like I couldnt find very much about this topic with any quick googling.
Thanks
You could set up the skills:
<skills>
<skill>..</skill>
<skill>..</skill>
and use a "repeat" content control pointing to the container. This would handle any number of <skill> entries.