Print Page | Close Window

About the ContentStream

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=3244
Printed Date: 11 Jul 25 at 8:21PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: About the ContentStream
Posted By: nieguizhi
Subject: About the ContentStream
Date Posted: 12 Jan 16 at 2:30AM
Hi professional:

I find that the below two pieces of code get the same results when I open the pdf file by the software of  AI. why?  I also get one layer, what is the function NewOptionalContentGroup means?
thank you.  look forward to your reply.

int OCG1 = DPL.NewOptionalContentGroup(L"group1");

DPL.SelectPage(1);
DPL.SetOrigin(1);

int cs1 = DPL.NewContentStream();
DPL.SelectContentStream(cs1);
DPL.DrawText(100,100,L"CS1");
DPL.SetContentStreamOptional(OCG1);
DPL.SetOptionalContentGroupVisible(OCG1, 1);

int OCG2 = DPL.NewOptionalContentGroup(L"group2");

int cs2 = DPL.NewContentStream();
DPL.SelectContentStream(cs2);
DPL.DrawText(100, 200, L"CS2");
DPL.SetContentStreamOptional(OCG2);
DPL.SetOptionalContentGroupVisible(OCG2, 1);

DPL.SaveToFile(L"newLayer.pdf");



////////////////////////////////////////////////////////////////////////////////
int OCG1 = DPL.NewOptionalContentGroup(L"group1");

DPL.SelectPage(1);
DPL.SetOrigin(1);

int cs1 = DPL.NewContentStream();
DPL.SelectContentStream(cs1);
DPL.DrawText(100,100,L"CS1");
DPL.SetContentStreamOptional(OCG1);
DPL.SetOptionalContentGroupVisible(OCG1, 1);


int cs2 = DPL.NewContentStream();
DPL.SelectContentStream(cs2);
DPL.DrawText(100, 200, L"CS2");
DPL.SetContentStreamOptional(OCG1);
DPL.SetOptionalContentGroupVisible(OCG1, 1);

DPL.SaveToFile(L"newLayer.pdf");






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