You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Damaji Kalunge <da...@technogise.com> on 2022/08/25 08:22:51 UTC

Re: PDF is not opening the Adobe reader when filled using COS Model and save using incremental Save.

Please find the attached filled PDF.

On Thu, Aug 25, 2022 at 1:51 PM Damaji Kalunge <da...@technogise.com>
wrote:

> Hi Team,
>    I am using the Apache PDFBox library ( 3.0.0-alpha3)and method to fill
> the PDF.
>    But it is not opening the Adobe Reader. Please find the attached
> screenshot.
>
>
> PDDocument pDDocument = Loader.loadPDF(new File("src/main/resources", "80.pdf"));
> if (pDDocument.isEncrypted()) {
>     try {
>
>         PDAcroForm pDAcroForm = pDDocument.getDocumentCatalog().getAcroForm();
>
>         COSDictionary  cosDictionary1=pDAcroForm.getField("ap.name fam").getCOSObject();
>
>        cosDictionary1.setString(COSName.V ,"family Name");
>         COSDictionary  cosDictionary2=pDAcroForm.getField("ap.birth cntry").getCOSObject();
>
>         cosDictionary2.setString(COSName.V ,"India");
>
>         COSDictionary  cosDictionary3=pDAcroForm.getField("ap.sex").getCOSObject();
>         cosDictionary3.setString(COSName.V ,"female");
>         COSDictionary  cosDictionary4=pDAcroForm.getField("ap.chinese").getCOSObject();
>         cosDictionary4.setString(COSName.V,"Yes");
>
>         FileOutputStream fileOutputStream = new FileOutputStream(new File("src/main/resources", "incrementalSave.pdf"));
>              Set<COSDictionary> set =new HashSet<>();
>         set.add(cosDictionary1);
>         set.add(cosDictionary2);
>         set.add(cosDictionary3);
>         set.add(cosDictionary4);
>         pDDocument.saveIncremental(fileOutputStream,set);
>        pDDocument.close();
>
>

Re: Re: PDF is not opening the Adobe reader when filled using COS Model and save using incremental Save.

Posted by Damaji Kalunge <da...@technogise.com>.
Hi Team,
   Please find the link of filled PDF

 [
https://drive.google.com/file/d/1uzjN6fag5a-MT2kOO0ifAVM9ZsMLqUpo/view?usp=sharing
]

On Thu, Aug 25, 2022 at 2:07 PM Damaji Kalunge <da...@technogise.com>
wrote:

> please find the attached PDF.
>
> On Thu, Aug 25, 2022 at 2:05 PM Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> Hi,
>> You need to upload the PDF somewhere. Attachments are deleted.
>> Tilman
>>
>>
>> --- Original-Nachricht ---
>> Von: Damaji Kalunge
>> Betreff: Re: PDF is not opening the Adobe reader when filled using COS
>> Model and save using incremental Save.
>> Datum: 25. August 2022, 10:22
>> An: users@pdfbox.apache.org
>>
>>
>> Please find the attached filled PDF.
>>
>> On Thu, Aug 25, 2022 at 1:51 PM Damaji Kalunge <damaji@technogise.com
>> <ma...@technogise.com> > wrote:
>>   Hi Team,
>>      I am using the Apache PDFBox library ( 3.0.0-alpha3)and method to
>> fill
>>   the PDF.
>>      But it is not opening the Adobe Reader. Please find the attached
>>   screenshot.
>>
>>
>>   PDDocument pDDocument = Loader.loadPDF(new File("src/main/resources",
>> "80.pdf"));
>>   if (pDDocument.isEncrypted()) {
>>       try {
>>
>>           PDAcroForm pDAcroForm =
>> pDDocument.getDocumentCatalog().getAcroForm();
>>
>>           COSDictionary  cosDictionary1=pDAcroForm.getField("
>>   <http://ap.name> fam").getCOSObject();
>>
>>          cosDictionary1.setString(COSName.V ,"family Name");
>>           COSDictionary  cosDictionary2=pDAcroForm.getField("ap.birth
>> cntry").getCOSObject();
>>
>>           cosDictionary2.setString(COSName.V ,"India");
>>
>>           COSDictionary
>> cosDictionary3=pDAcroForm.getField("ap.sex").getCOSObject();
>>           cosDictionary3.setString(COSName.V ,"female");
>>           COSDictionary
>> cosDictionary4=pDAcroForm.getField("ap.chinese").getCOSObject();
>>           cosDictionary4.setString(COSName.V,"Yes");
>>
>>           FileOutputStream fileOutputStream = new FileOutputStream(new
>> File("src/main/resources", "incrementalSave.pdf"));
>>                Set<COSDictionary> set =new HashSet<>();
>>           set.add(cosDictionary1);
>>           set.add(cosDictionary2);
>>           set.add(cosDictionary3);
>>           set.add(cosDictionary4);
>>           pDDocument.saveIncremental(fileOutputStream,set);
>>          pDDocument.close();
>
>

Re: Re: PDF is not opening the Adobe reader when filled using COS Model and save using incremental Save.

Posted by Damaji Kalunge <da...@technogise.com>.
HI Team,
  Please find the filld PDF link below :

On Thu, Aug 25, 2022 at 2:07 PM Damaji Kalunge <da...@technogise.com>
wrote:

> please find the attached PDF.
>
> On Thu, Aug 25, 2022 at 2:05 PM Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> Hi,
>> You need to upload the PDF somewhere. Attachments are deleted.
>> Tilman
>>
>>
>> --- Original-Nachricht ---
>> Von: Damaji Kalunge
>> Betreff: Re: PDF is not opening the Adobe reader when filled using COS
>> Model and save using incremental Save.
>> Datum: 25. August 2022, 10:22
>> An: users@pdfbox.apache.org
>>
>>
>> Please find the attached filled PDF.
>>
>> On Thu, Aug 25, 2022 at 1:51 PM Damaji Kalunge <damaji@technogise.com
>> <ma...@technogise.com> > wrote:
>>   Hi Team,
>>      I am using the Apache PDFBox library ( 3.0.0-alpha3)and method to
>> fill
>>   the PDF.
>>      But it is not opening the Adobe Reader. Please find the attached
>>   screenshot.
>>
>>
>>   PDDocument pDDocument = Loader.loadPDF(new File("src/main/resources",
>> "80.pdf"));
>>   if (pDDocument.isEncrypted()) {
>>       try {
>>
>>           PDAcroForm pDAcroForm =
>> pDDocument.getDocumentCatalog().getAcroForm();
>>
>>           COSDictionary  cosDictionary1=pDAcroForm.getField("
>>   <http://ap.name> fam").getCOSObject();
>>
>>          cosDictionary1.setString(COSName.V ,"family Name");
>>           COSDictionary  cosDictionary2=pDAcroForm.getField("ap.birth
>> cntry").getCOSObject();
>>
>>           cosDictionary2.setString(COSName.V ,"India");
>>
>>           COSDictionary
>> cosDictionary3=pDAcroForm.getField("ap.sex").getCOSObject();
>>           cosDictionary3.setString(COSName.V ,"female");
>>           COSDictionary
>> cosDictionary4=pDAcroForm.getField("ap.chinese").getCOSObject();
>>           cosDictionary4.setString(COSName.V,"Yes");
>>
>>           FileOutputStream fileOutputStream = new FileOutputStream(new
>> File("src/main/resources", "incrementalSave.pdf"));
>>                Set<COSDictionary> set =new HashSet<>();
>>           set.add(cosDictionary1);
>>           set.add(cosDictionary2);
>>           set.add(cosDictionary3);
>>           set.add(cosDictionary4);
>>           pDDocument.saveIncremental(fileOutputStream,set);
>>          pDDocument.close();
>
>

Re: Re: PDF is not opening the Adobe reader when filled using COS Model and save using incremental Save.

Posted by Damaji Kalunge <da...@technogise.com>.
Please find link to open filld PDF.

On Thu, Aug 25, 2022 at 2:07 PM Damaji Kalunge <da...@technogise.com>
wrote:

> please find the attached PDF.
>
> On Thu, Aug 25, 2022 at 2:05 PM Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> Hi,
>> You need to upload the PDF somewhere. Attachments are deleted.
>> Tilman
>>
>>
>> --- Original-Nachricht ---
>> Von: Damaji Kalunge
>> Betreff: Re: PDF is not opening the Adobe reader when filled using COS
>> Model and save using incremental Save.
>> Datum: 25. August 2022, 10:22
>> An: users@pdfbox.apache.org
>>
>>
>> Please find the attached filled PDF.
>>
>> On Thu, Aug 25, 2022 at 1:51 PM Damaji Kalunge <damaji@technogise.com
>> <ma...@technogise.com> > wrote:
>>   Hi Team,
>>      I am using the Apache PDFBox library ( 3.0.0-alpha3)and method to
>> fill
>>   the PDF.
>>      But it is not opening the Adobe Reader. Please find the attached
>>   screenshot.
>>
>>
>>   PDDocument pDDocument = Loader.loadPDF(new File("src/main/resources",
>> "80.pdf"));
>>   if (pDDocument.isEncrypted()) {
>>       try {
>>
>>           PDAcroForm pDAcroForm =
>> pDDocument.getDocumentCatalog().getAcroForm();
>>
>>           COSDictionary  cosDictionary1=pDAcroForm.getField("
>>   <http://ap.name> fam").getCOSObject();
>>
>>          cosDictionary1.setString(COSName.V ,"family Name");
>>           COSDictionary  cosDictionary2=pDAcroForm.getField("ap.birth
>> cntry").getCOSObject();
>>
>>           cosDictionary2.setString(COSName.V ,"India");
>>
>>           COSDictionary
>> cosDictionary3=pDAcroForm.getField("ap.sex").getCOSObject();
>>           cosDictionary3.setString(COSName.V ,"female");
>>           COSDictionary
>> cosDictionary4=pDAcroForm.getField("ap.chinese").getCOSObject();
>>           cosDictionary4.setString(COSName.V,"Yes");
>>
>>           FileOutputStream fileOutputStream = new FileOutputStream(new
>> File("src/main/resources", "incrementalSave.pdf"));
>>                Set<COSDictionary> set =new HashSet<>();
>>           set.add(cosDictionary1);
>>           set.add(cosDictionary2);
>>           set.add(cosDictionary3);
>>           set.add(cosDictionary4);
>>           pDDocument.saveIncremental(fileOutputStream,set);
>>          pDDocument.close();
>
>

Re: Re: PDF is not opening the Adobe reader when filled using COS Model and save using incremental Save.

Posted by Damaji Kalunge <da...@technogise.com>.
please find the attached PDF.

On Thu, Aug 25, 2022 at 2:05 PM Tilman Hausherr <TH...@t-online.de>
wrote:

> Hi,
> You need to upload the PDF somewhere. Attachments are deleted.
> Tilman
>
>
> --- Original-Nachricht ---
> Von: Damaji Kalunge
> Betreff: Re: PDF is not opening the Adobe reader when filled using COS
> Model and save using incremental Save.
> Datum: 25. August 2022, 10:22
> An: users@pdfbox.apache.org
>
>
> Please find the attached filled PDF.
>
> On Thu, Aug 25, 2022 at 1:51 PM Damaji Kalunge <damaji@technogise.com
> <ma...@technogise.com> > wrote:
>   Hi Team,
>      I am using the Apache PDFBox library ( 3.0.0-alpha3)and method to fill
>   the PDF.
>      But it is not opening the Adobe Reader. Please find the attached
>   screenshot.
>
>
>   PDDocument pDDocument = Loader.loadPDF(new File("src/main/resources",
> "80.pdf"));
>   if (pDDocument.isEncrypted()) {
>       try {
>
>           PDAcroForm pDAcroForm =
> pDDocument.getDocumentCatalog().getAcroForm();
>
>           COSDictionary  cosDictionary1=pDAcroForm.getField("
>   <http://ap.name> fam").getCOSObject();
>
>          cosDictionary1.setString(COSName.V ,"family Name");
>           COSDictionary  cosDictionary2=pDAcroForm.getField("ap.birth
> cntry").getCOSObject();
>
>           cosDictionary2.setString(COSName.V ,"India");
>
>           COSDictionary
> cosDictionary3=pDAcroForm.getField("ap.sex").getCOSObject();
>           cosDictionary3.setString(COSName.V ,"female");
>           COSDictionary
> cosDictionary4=pDAcroForm.getField("ap.chinese").getCOSObject();
>           cosDictionary4.setString(COSName.V,"Yes");
>
>           FileOutputStream fileOutputStream = new FileOutputStream(new
> File("src/main/resources", "incrementalSave.pdf"));
>                Set<COSDictionary> set =new HashSet<>();
>           set.add(cosDictionary1);
>           set.add(cosDictionary2);
>           set.add(cosDictionary3);
>           set.add(cosDictionary4);
>           pDDocument.saveIncremental(fileOutputStream,set);
>          pDDocument.close();

AW: Re: PDF is not opening the Adobe reader when filled using COS Model and save using incremental Save.

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,
You need to upload the PDF somewhere. Attachments are deleted.
Tilman


--- Original-Nachricht ---
Von: Damaji Kalunge
Betreff: Re: PDF is not opening the Adobe reader when filled using COS 
Model and save using incremental Save.
Datum: 25. August 2022, 10:22
An: users@pdfbox.apache.org


Please find the attached filled PDF.

On Thu, Aug 25, 2022 at 1:51 PM Damaji Kalunge <damaji@technogise.com
<ma...@technogise.com> > wrote:
  Hi Team,
     I am using the Apache PDFBox library ( 3.0.0-alpha3)and method to fill
  the PDF.
     But it is not opening the Adobe Reader. Please find the attached
  screenshot.
     

  PDDocument pDDocument = Loader.loadPDF(new File("src/main/resources", "80.pdf"));
  if (pDDocument.isEncrypted()) {
      try {

          PDAcroForm pDAcroForm = pDDocument.getDocumentCatalog().getAcroForm();

          COSDictionary  cosDictionary1=pDAcroForm.getField("
  <http://ap.name> fam").getCOSObject();

         cosDictionary1.setString(COSName.V ,"family Name");
          COSDictionary  cosDictionary2=pDAcroForm.getField("ap.birth cntry").getCOSObject();

          cosDictionary2.setString(COSName.V ,"India");

          COSDictionary  cosDictionary3=pDAcroForm.getField("ap.sex").getCOSObject();
          cosDictionary3.setString(COSName.V ,"female");
          COSDictionary  cosDictionary4=pDAcroForm.getField("ap.chinese").getCOSObject();
          cosDictionary4.setString(COSName.V,"Yes");
          
          FileOutputStream fileOutputStream = new FileOutputStream(new File("src/main/resources", "incrementalSave.pdf"));
               Set<COSDictionary> set =new HashSet<>();
          set.add(cosDictionary1);
          set.add(cosDictionary2);
          set.add(cosDictionary3);
          set.add(cosDictionary4);
          pDDocument.saveIncremental(fileOutputStream,set);
         pDDocument.close();