Print Page | Close Window

PDF Object types

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3019
Printed Date: 14 Jun 25 at 4:58PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: PDF Object types
Posted By: Chopinke
Subject: PDF Object types
Date Posted: 27 Nov 14 at 2:22PM
I can see there is a function in the SDK to get all objects contained in the PDF. How can I get the type of that object?

The reason is that on a PDF somebody put a blue rectangle with Adobe Illustrator. I am trying to find what object is that.

Thanks!



Replies:
Posted By: Ingo
Date Posted: 29 Nov 14 at 11:08AM
Hi Chopinke,

is it possible for you to upload the file anywhere?
Perhpas could be interesting for me and for other ones, too ;-)
In this case i often do some search directly in the pdf code wit a "normal" texteditor.

Cheers,
Ingo




-------------
Cheers,
Ingo



Posted By: Chopinke
Date Posted: 29 Nov 14 at 1:36PM
Hi,

Here is the file:
https://www.dropbox.com/s/hsjb129s3p6xioq/links_stamped.pdf?dl=0

There is a blue rectangle at the top right side. It was added by Illustrator. I can see this is the object in the file:

----------------
6 0 obj
<</ArtBox[0.0 0.0 1275.0 1650.0]/BleedBox[0.0 0.0 1275.0 1650.0]/Contents 7 0 R/CropBox[0 0 1275 1650]/LastModified(D:20141118213821+01'00')/MediaBox[0 0 1275 1650]/Parent 1 0 R/PieceInfo<</Illustrator 11 0 R>>/Resources<</ExtGState<</GS0 8 0 R>>/ProcSet[/PDF/ImageC]/Properties<</MC0 9 0 R>>/XObject<</Im0 10 0 R>>>>/Rotate 0/TrimBox[0.0 0.0 1275.0 1650.0]/Type/Page>>
endobj
----------------

But ArtBox, BleedBox or CropBox is not exactly this blue rectangle, I saw another file modified by PhotoShop, some text added, and PhotoShop also added these 'boxes'.

I thought there was an object type like text, or annotation.

Your help is appreciated.

Thank!


Posted By: AndrewC
Date Posted: 30 Nov 14 at 3:43AM
It is not an object but part of the drawing commands.  The ContentStreams as part of the "/Contents 7 0 R" object

The blue rectangle has been added as a set of drawing commands in the Contentstream.  Normally there are hundreds of commands to draw lines, text, shading, images but this PDF is very simple and only contains an Image and a blue rectangle.

<Start>
/Layer /MC0 BDC 
q
/GS0 gs
1275 0 0 1650 0 0 cm
/Im0 Do                        <------- Draw the background image
Q
0.18 0.18 0.749 rg       <------- Blue
/GS0 gs
1128 1570 -41 40 re    <------- Rectangle
f
EMC 
<End>

Also, the PDF was stamped with AltaStampCreator and not Illustrator.

Andrew.





Posted By: Chopinke
Date Posted: 02 Dec 14 at 12:46PM
Hi,

Thanks for the info, actually AltaStampCreator is our product, and the blue rectangle was added by Adobe Illustrator, or I believe that's what "</Illustrator 11 0 R> " means.

The PDF is created by our product: A totally empty PDF with a single BMP image embedded, nothing else. I have to detect any modifications on PDF structure level, before I extract that embedded image and examine it as a bitmap. If there are changes, like annotation added, or in this case, blue rectangle, I use the render page to produce a 'combined' canvas as a bitmap.

The speed is critical, so I use the '...count' properties to see if there are any modifications made, like AnnotationCount. I could always use render page method, but that is much slower than a few IFs and then extracting the image.

In the current case I could not find how I can check that blue rectangle using the API's methods or properties. I use Delphi XE7. I went for detecting the presence of ArtBox, because I know I did not create one in the first place, so if it's present, it was a modification by somebody else.

Thanks!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk