I was thinking about the process of saving a pddocument.

Correct me if I am wrong:

It has an array of pdpages and each page has  PDPageContentStream which
keeps the data of the array.

This class organizes its objects in a map called xobjects. This map is
formed by a string mapping the name and a PDXObject.

 

So, is it right to think that I can put a new image for a mapping that
already exists and then when the pdfbox saves the pddocument it will save
with the new image?

 

                //inside the PDPageContentStream

                String mapping = xobjectMappings.get(oldImage);

      if(mapping!=null && newImage!=null)

            xobjects.put( mapping, newImage);

 

 

 

 

well, it seems that this is not the correct way. Or maybe I’m doing
something wrong. I could use some help here.

 

Thank you.

 

 

 

 

Reply via email to