You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Haddy, Diane E" <di...@uiowa.edu> on 2016/03/08 23:12:10 UTC

creating a rectangle around the whole pdf

Hello

I am very new to PDFBox.  I am creating a pdf form of which I need  to create an outer rectangle around the whole form and then in the center I need to create two rectangles adjacent to one another.  Also the header info. to surround the two adjacent rectangles is in its own rectangle and the background is pale gray.

Can someone provide me a snippet of code and perhaps a pdf for visual purposes?  I do have the PDFBox api but not sure which classes to use to achieve what I want.

Also for this line in the pdf, is there a way to add an underline to what is highlighted in red?

This is my java code:    title.drawString("Request form must be used within 30 days of " + formatDate  );

Request form must be used within 30 days of 03/07/2016



Thanks in advance for any help in this matter.

Diane

Diane Haddy

Health Care Information Systems
Application Developer
3281 Ridgeway Dr
Coralville, IA 52241




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________

Re: creating a rectangle around the whole pdf

Posted by Tilman Hausherr <TH...@t-online.de>.
Hello Diane,

To draw a rectangle, see the ShowColorBoxes.java example in the source 
code download. However set the stroking color and call stroke() instead 
of fill(). To draw a form, use the CreateSimpleForm.java example.

Creating forms is still somewhat tricky, so after having done what you 
can, please post your code and ask more.

Tilman



Am 08.03.2016 um 23:12 schrieb Haddy, Diane E:
> Hello
>
> I am very new to PDFBox.  I am creating a pdf form of which I need  to create an outer rectangle around the whole form and then in the center I need to create two rectangles adjacent to one another.  Also the header info. to surround the two adjacent rectangles is in its own rectangle and the background is pale gray.
>
> Can someone provide me a snippet of code and perhaps a pdf for visual purposes?  I do have the PDFBox api but not sure which classes to use to achieve what I want.
>
> Also for this line in the pdf, is there a way to add an underline to what is highlighted in red?
>
> This is my java code:    title.drawString("Request form must be used within 30 days of " + formatDate  );
>
> Request form must be used within 30 days of 03/07/2016
>
>
>
> Thanks in advance for any help in this matter.
>
> Diane
>
> Diane Haddy
>
> Health Care Information Systems
> Application Developer
> 3281 Ridgeway Dr
> Coralville, IA 52241
>
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
> ________________________________
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org