Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Content Stream <> Layers
  FAQ FAQ  Forum Search   Register Register  Login Login

Content Stream <> Layers

 Post Reply Post Reply
Author
Message
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Topic: Content Stream <> Layers
    Posted: 03 Feb 15 at 7:36PM
here:
http://www.debenu.com/products/development/debenu-pdf-library/features/pdf-layers-sdk/

I read:

"All PDF content is grouped into Content Streams. A Content Stream might include, for example, formatted text, an image or a form field. These elements can be precisely placed to produce the familiar pages we see in our PDF viewers."
and
"we would say that Content Streams can be placed on individual Layers."

I want to ask:
What is a difference between Content Stream <> Layers ?

As I understand it the Content Stream
is simply the content of the layers


Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 15 at 5:16AM
Michal,

Content streams are just a way to break up a large single content stream into blocks though it is not really necessary.  When the PDF is rendered it effectively combines all of the streams during rendering, stream 1 is rendered first then stream 2 and so on.

There are some special cases but this is for advanced usage and requires special attention to make sure the streams are valid.

1. Shared Content Stream - A background template may be created for page 1 of a PDF and that content stream can be shared for all subsequent pages.

2. Sometimes Debenu PDF Library customers create a new stream, add a watermark type logo to the stream and then move / insert the content stream as stream 1.  This has the effect of drawing the watermark image first so that all other content is drawn on top.

3. Some people use a contentstream for each Optional Content Group which is the closest thing to layers in the PDF format.  Again this needs to be managed carefully.

If content streams are used for layering then they should be self contained and begin with a SaveState and finish with a RestoreState command in order to restore the grapihcs state, scaling, rotation etc..

Content streams can be used for various reasons.  When you want to use CapturePage / DrawCapturedPage in the library then you should call QP.RemoveSharedContentStreams which creates copies of contents streams so that none are shared, making the PDF larger, but allowing the pages of the PDF to be extracted without errors.  ie.  If you delete page 1 that contains the shared content stream them all other pages would become invalid because of the missing shared content stream.  Also a call to QP.CombineContentStreams is required so that all streams are merged into one single stream that makes copying quicker and easier.

Andrew.
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 15 at 9:11PM
Thanks for such a broad explanation
mLipok

Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store