# How to Print A Document Only

**URL:** <https://www.ruby-forum.com/t/how-to-print-a-document-only/140398>\
**Category:** Rails\
**Created:** [June 13, 2008, 4:13pm UTC](https://www.ruby-forum.com/t/how-to-print-a-document-only/140398 "2008-06-13T16:13:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [June 13, 2008, 4:13pm UTC](https://www.ruby-forum.com/t/how-to-print-a-document-only/140398/1 "2008-06-13T16:13:41Z")

</div>

I am using PDF::writer to convert text to pdf files for printing. What I  
would like to do is to be able to print it without allowing the user to  
be able to read the files in pdf. What options do I have ?

If I send the files directly to the printer will I have difficulty down  
the road with formatting text or embedding pictures in the printable  
document? Is there some workaround where I make the pdf “not readable”  
or “unopenable” (when downloading) ? Can I make the pdf password secure  
and not give the user the password and then only allow printing on the  
document?

Thanks

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [June 24, 2008, 1:14pm UTC](https://www.ruby-forum.com/t/how-to-print-a-document-only/140398/2 "2008-06-24T13:14:22Z")

</div>

Anyone ?

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [June 24, 2008, 1:27pm UTC](https://www.ruby-forum.com/t/how-to-print-a-document-only/140398/3 "2008-06-24T13:27:17Z")

</div>

On Jun 24, 12:13 pm, “alexey.Creopolis” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Anyone ?

I know nothing about pdf, but this sounds more than a little tricky,  
given that on most computers you can have a virtual printer that just  
creates a pdf of what you’re trying to print. That an the pdf is bound  
to be stashed in some temporary folder somewhere.

Fred

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [June 24, 2008, 3:44pm UTC](https://www.ruby-forum.com/t/how-to-print-a-document-only/140398/4 "2008-06-24T15:44:01Z")

</div>

I was informed of an approach :

1. create a page sized button (from form -\> button) and give it a black  
background thereby obstructing each page of the pdf.
2. set the property of the button to “visible but not printable”

This allows the button to obstruct the view but when you print it it is  
like the button is not even there.

Now my task is attempting to find out if there is a pdf package that  
allows you to create form elements (pdf form elements) like buttons etc.  
because I am currently using pdf::writer and Austin Zeigler said he has  
no such functionality in there but recommends I write to pdf-writer’s  
google group.

---

<div class="post-metadata">

**Author:** ![ror\_arch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ror\_arch](https://www.ruby-forum.com/u/ror_arch)\
**Post date:** [June 24, 2008, 1:36pm UTC](https://www.ruby-forum.com/t/how-to-print-a-document-only/140398/5 "2008-06-24T13:36:05Z")

</div>

I had two ready steps:

1. creating images from ROR application (tickets with order details)  
thru rmagick::svg module,
2. ruby script witch generate&print xls for me, by ROR requests,  
(“print xls” button from site)

But goal now is to pring png images, witch cannot be done by (2) …

On Jun 24, 1:25 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
