1

It is true that PDF have 2 layer - image layer and text layer?

If it's true, so how I can get image layer from PDF to print it?

WelcomeTo
  • 19,843
  • 53
  • 170
  • 286

1 Answers1

4

No it is not true. The pdf content stream is a binary stream with basic primitives: draw share, draw image, position pointer x,y, draw text..etc

PDF however also have layers, those are like several content stream stacked on top of each others. While technically feasible, I never saw any PDF where images were is a separate layer.

Olivier Refalo
  • 50,287
  • 22
  • 91
  • 122
  • +1 - A brief scan through the PDF specification (http://www.adobe.com/devnet/pdf/pdf_reference.html) confirms this. – Stephen C Aug 24 '12 at 14:01
  • I can't, b/c you won't find in the spec a statement saying "images should be in a different layer" - Image operators or just like other operators and can appear on any layer. In fact if you want to build a pdf with imgs in separate layers, you certainly can. But that's not how PDF are typically generated. – Olivier Refalo Aug 24 '12 at 14:19
  • `PDF however also have layers, those are like several content stream stacked on top of each others.`can you explain more deeper what you mean here? – WelcomeTo Aug 24 '12 at 14:21
  • 1
    the content stream is like a list of orders to a pencil, move to (x,y), draw a circle, setColor red, draw Image...etc You may find the list of operators in Appendix A - http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf Typically a page has one content stream, but with layers, you can have several. So think about it, you are rendering your first page, then the first layer kicks in and draws another content on top of the previous one. that's what I meant - layers are stacked content streams – Olivier Refalo Aug 24 '12 at 14:23
  • 1
    This statement "Typically a page has one content stream, but with layers, you can have several" and this one "layers are stacked content streams" are not correct. Layers and content streams are unrelated. You can have as many content streams as you want without having layers, and you can have layers with only one content stream per page. – yms Aug 24 '12 at 17:49
  • A PDF page is composed by a sequence of drawing operations, layers are defined (among other things) by special operators inside the page that enclose the operations that the layer will contain. This way you can have layers that contain other layers etc. – yms Aug 24 '12 at 17:52
  • @MyTitle: "Layers" are "Optional Content Groups" in the PDF spec. – Martin Schröder Aug 26 '12 at 20:40