pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Kaufman <kauf...@cs.stanford.edu>
Subject Re: How to identify underlying COSObject for a PDXObject or PDXObject for COSObject
Date Mon, 23 Jul 2018 18:22:16 GMT
A PDF XObject doesn't have a unique position. The ultimate position on 
the page is determined by the current transformation matrix in the 
content stream:

    The BBox entry in the form dictionary is expressed in form space, as
    are any coordinates used in the form XObject’s content stream, such
    as path coordinates. The Matrix entry in the form dictionary
    specifies the mapping from form space to the current user space.
    Each time the form XObject is painted by the Do operator, this
    matrix is concatenated with the current transformation matrix to
    define the mapping from form space to device space.

On 7/23/2018 10:12 AM, Ranjit Saripalli wrote:
> Hi Tilman,
> Thanks for you response. I can get position of the image in pdf as it is
> in  printimagelocations example but I am trying to get the the location of
> COSObject.
>   Let me try to keep my question simple, I have a COSObject with X and Y
> coordinate values  as below. How to get the actual location (lowerleftX,
> lowerleftY, upperrightX, upperrightY) of this object from this X and Y
> coordinates.
> COSDictionary{COSName{N}:COSString{xcoordinate};COSName{V}:COSString{
> 0,220000000000001};}, COSDictionary{COSName{N}:COSString{ycoordinate
> };COSName{V}:COSString{0,22};},
> Thanks,
> Ranjit
> On Mon, Jul 23, 2018 at 10:06 PM, Tilman Hausherr <THausherr@t-online.de>
> wrote:
>> Hi, I'm not sure if this is the answer to your question (which I haven't
>> really understood), but please try the PrintImageLocations.java example
>> from the source code download.
>> Image objects do not know their own location(s).
>> Tilman
>> Am 23.07.2018 um 08:50 schrieb Ranjit Saripalli:
>>> Hi,
>>> I am trying to get location (Rectangle) of a COSObject but it seems only
>>> xcoordinate and ycoordinate information is available for COSObject. I can
>>> get the required details (location) from a PDXobject (PDXImage and
>>> PDXFormObject) which is good but I am not able to find a corresponding
>>> COSObject ( from PDXObject) and PDXObject has no User attribute values. I
>>> need both user attribute information and location, unfortunately I cannot
>>> get both from either one object (XObject or COSObject).
>>> I was hoping to somehow identify COSObject from a PDXObject so I can get
>>> location from XObject and then attribute values from corresponding
>>> COSObject.
>>> Could someone please share a way to identify corresponding COSObject from
>>> an XObject or a way to get both user attribute values and location of an
>>> element in PDF?
>>> Thanks in advance.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org

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