Thanks for the answer and sorry for my late response but I have been working in another project.
Using the scanned recipe and using Adobe Designer (version 7) I have added form fields (acroforms) where needed. Then, using iText, I read the PDF and fill the fields. What I don' know how to do it is how to define background content as optional content. In antother post, a user explains how to do it with Acrobat professional (http://forums.adobe.com/message/1175920) : Create a PDF document with empty pages. Use Document > Background > Add/Replace... to add your scanned PDF document as background. In the appearance options disable the entry 'Show when printing'. Then you add the form fields to your document With Adobe Acrobat Professional 7 I can't find the option to add a background to an empty PDF. In iText examples, I have found a class called OptionalContentExample were it defined a PDFLayer that can be seen when viewing the PDf but not when printing it : PdfLayer not_printed = new PdfLayer("not printed", writer); not_printed.setOnPanel(false); not_printed.setPrint("Print", false); cb.beginLayer(not_printed); ColumnText.showTextAligned(cb, Element.ALIGN_CENTER, new Phrase( "PRINT THIS PAGE"), 300, 700, 90); cb.endLayer(); Do I need to use something similar to hide all the background ? Thanks ! 1T3XT info wrote: > > Pep Grifell wrote: >> hi there, >> >> I have a preprinted medical recipe and I need to fill some fields in it >> from my web app. >> >> One of the ideas I had is to scan the recipe in a PDF, and then fill the >> gaps (by this way, I will not have to print the recipe and spend paper >> in vain). > > Why scan it? > Don't you have the original document in digital format? > > Suppose you don't, then you have to scan the document, > and create a PDF with the raster image that was obtained. > > Then you have to add form fields to that PDF. > You can do this, for instance with Adobe Acrobat. > Make sure that you add AcroForm fields (Text field annotations). > Please don't create an XFA form. > >> Once I will have all the gaps filled and the text placed correclty, > > You're one step too quickly: you shouldn't fill the gaps! > First you have to define the fillable areas. > Then you can use iText to fill the gaps. > >> I >> will generate a PDF with the text (withou the preprinted recipe) > > One way to do this, is to put the background in an "optional > content group". "Optional" in the sense that it is visible > when viewed on screen, but not visible when printed on paper. > >> and I >> will send it to the printer, where I will have the preprinted paper. > > That's what the "optional content" is about ;-) > >> This can be done with iText ? > > Of course, you can do the filling and the optional content stuff > with iText, but you'll have to define the coordinates of the gaps > manually first using another tool. If you don't have any other tool, > you can measure the coordinates manually (using a ruler) and then > use the coordinates you've obtained in iText. > -- > This answer is provided by 1T3XT BVBA > http://www.1t3xt.com/ - http://www.1t3xt.info > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.itextpdf.com/book/ > Check the site with examples before you ask questions: > http://www.1t3xt.info/examples/ > You can also search the keywords list: > http://1t3xt.info/tutorials/keywords/ > > 1T3XT info wrote: > > Pep Grifell wrote: >> hi there, >> >> I have a preprinted medical recipe and I need to fill some fields in it >> from my web app. >> >> One of the ideas I had is to scan the recipe in a PDF, and then fill the >> gaps (by this way, I will not have to print the recipe and spend paper >> in vain). > > Why scan it? > Don't you have the original document in digital format? > > Suppose you don't, then you have to scan the document, > and create a PDF with the raster image that was obtained. > > Then you have to add form fields to that PDF. > You can do this, for instance with Adobe Acrobat. > Make sure that you add AcroForm fields (Text field annotations). > Please don't create an XFA form. > >> Once I will have all the gaps filled and the text placed correclty, > > You're one step too quickly: you shouldn't fill the gaps! > First you have to define the fillable areas. > Then you can use iText to fill the gaps. > >> I >> will generate a PDF with the text (withou the preprinted recipe) > > One way to do this, is to put the background in an "optional > content group". "Optional" in the sense that it is visible > when viewed on screen, but not visible when printed on paper. > >> and I >> will send it to the printer, where I will have the preprinted paper. > > That's what the "optional content" is about ;-) > >> This can be done with iText ? > > Of course, you can do the filling and the optional content stuff > with iText, but you'll have to define the coordinates of the gaps > manually first using another tool. If you don't have any other tool, > you can measure the coordinates manually (using a ruler) and then > use the coordinates you've obtained in iText. > -- > This answer is provided by 1T3XT BVBA > http://www.1t3xt.com/ - http://www.1t3xt.info > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.itextpdf.com/book/ > Check the site with examples before you ask questions: > http://www.1t3xt.info/examples/ > You can also search the keywords list: > http://1t3xt.info/tutorials/keywords/ > > -- View this message in context: http://itext-general.2136553.n4.nabble.com/print-text-in-a-preprinted-pdf-tp2291532p2323938.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
