pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Cashion <jcash...@claremontbiosolutions.com>
Subject Re: PDFBox markup printing on silent
Date Mon, 28 Jan 2013 23:59:04 GMT
Here was my solution for those that need it in the future. Since i couldn't
find something directly in pdfbox, I used the Desktop to call the reader
file and then print that natively from the desktop. example code is here

    public void printOrder(){
        try {
            File myFile = new File(finished);
            //Desktop.getDesktop().open(myFile);
            Desktop.getDesktop().print(myFile);
            doc.close();
        } catch (IOException ex) {
            // no application registered for PDFs
        }
    }




On Sat, Jan 26, 2013 at 1:12 PM, John Cashion <
jcashion@claremontbiosolutions.com> wrote:

> Hey Andreas, I skimmed your email too quickly! just saw the links at the
> bottom. Thanks!
>
>
> On Sat, Jan 26, 2013 at 1:00 PM, John Cashion <
> jcashion@claremontbiosolutions.com> wrote:
>
>> Hey Andreas,
>> I realized just now that I sent it to users and not user-subscribe, so I
>> just sent in another email "registering" myself. I'm new to mailing lists,
>> is there any way to check the archives of the emails I might I have missed,
>> and any replies that might have come through? I checked the pdfbox page and
>> couldn't find an archive link. Also, I still have the same problem in my
>> original email, I like everything I have so far, but I'm still not sure if
>> the ability to print markup's silently exists?
>>  thank you
>> John
>>
>>
>> On Fri, Jan 25, 2013 at 10:48 PM, Andreas Lehmkuehler <andreas@lehmi.de>wrote:
>>
>>> Hi,
>>>
>>> Am 26.01.2013 01:11, schrieb John Cashion:
>>>
>>>  Hey Guys, I Hope I am sending this through the proper channels, but it
>>>> seems the forum for pdfbox is down, so i figured I would try the mailing
>>>> list.
>>>>
>>> There is no other official forum than our mailing lists! So finally you
>>> found us, the PDFBox community. [1]
>>> Be sure to subscribe yourself to the mailing list [2] otherwise you
>>> won't get
>>> any answers.
>>>
>>>
>>>  I've got a form that I've created and I'm stuck on trying to print
>>>> the form with markups. I looked at the flags, but I am unsure if I'm on
>>>> the
>>>> right track. I can save the document with markup's just fine, but I
>>>> cannot
>>>> silently print them. Is there an annotation setting that I'm missing?
>>>> here
>>>> is my current code. Also, is there a new forum where this project is
>>>> active. I like using PDFBox but the information on it is... sparse.
>>>> Thanks
>>>> for your time.
>>>>
>>> Did you get what you want using the PDFReader coming with PDFBox? Maybe
>>> the feature you are looking for isn't yet supported
>>>
>>>
>>>
>>>>          PDDocument doc = null;
>>>>
>>>>         try{
>>>>              doc = PDDocument.load("resources/**orderForm.pdf");
>>>>              PDDocumentCatalog docCatalog = doc.getDocumentCatalog();
>>>>              PDAcroForm acroForm = docCatalog.getAcroForm();
>>>>              PDField field = acroForm.getField("Qty1");
>>>>              field.setValue("JohnTest");
>>>>              field.setFieldFlags(4);
>>>>              //PDAnnotation.FLAG_PRINTED;
>>>>
>>>>          } catch (IOException ie){
>>>>              System.out.println(ie);
>>>>          }
>>>>          //doc.addPage(new PDPage());
>>>>          try{
>>>>
>>>>              doc.save("Empty PDF.pdf");
>>>>              //doc.silentPrint();
>>>>              doc.print();
>>>>              doc.close();
>>>>          } catch (Exception io){
>>>>              System.out.println(io);
>>>>          }
>>>>
>>>>      }
>>>>
>>>>
>>>>
>>>> thanks!
>>>>
>>>> John
>>>>
>>>>
>>>
>>> BR
>>> Andreas Lehmkühler
>>> [1] http://pdfbox.apache.org
>>> [2] http://pdfbox.apache.org/mail-**lists.html<http://pdfbox.apache.org/mail-lists.html>
>>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message