Print Page | Close Window

printing layers/ocgs

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=2483
Printed Date: 04 Feb 26 at 5:27AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: printing layers/ocgs
Posted By: MartinCS
Subject: printing layers/ocgs
Date Posted: 09 Jan 13 at 11:36AM
Hi,

we encountered a problem using the latest build of the quickpdf library (version 912).

I have a document with a collection of layers/optional content groups on it and would like to print a selected layer by choice. But the print out of the pdf document always results in an empty pdf document. I do get the right paper size. But the content of the selected, visable and printable layer is not in the printed document. If I use the build 911 the printed document shows the whole content of the source document. It seems like it ignores the optional content group settings 'printable' and 'visable'.

I've read the help and found these two methods:

http://www.quickpdflibrary.com/help/quickpdf/SetOptionalContentGroupPrintable.php - http://www.quickpdflibrary.com/help/quickpdf/SetOptionalContentGroup - Printable.php
http://www.quickpdflibrary.com/help/quickpdf/SetOptionalContentGroupVisible.php - http://www.quickpdflibrary.com/help/quickpdf/SetOptionalContentGroupVisible.php

Here's the code I'm using:

Dim qp As Variant
Dim tFileIn As String
Dim tFileOut As String
Dim tCustomPrinter As String
Dim lQPLayerCount As Long
Dim lQPLayerID As Long 

Set qp = CreateObject("DebenuPDFLibraryAX0912.PDFLibrary")
Call qp.UnlockKey("<REGKEY>")

tFileIn = "d:\test_Layer.pdf"
tFileOut = "d:\test_PRINT.pdf"

' make ALL layers visible (test file does only have one layer)
lQPLayerCount = qp.OptionalContentGroupCount()
Do While (lQPLayerCount > 0)
lQPLayerID = qp.GetOptionalContentGroupID(lQPLayerCount)
Call qp.SetOptionalContentGroupPrintable(lQPLayerID, 1)
Call qp.SetOptionalContentGroupVisible(lQPLayerID, 1)
lQPLayerCount = lQPLayerCount - 1
Loop

Call qp.UseUnsafeContentStreams(1)

tCustomPrinter = qp.NewCustomPrinter(PdfXChangeDriversAPI.PrinterName())

Call qp.PrintDocument(tCustomPrinter, 1 , 1, 0)

If I check the document properties of the source document in Adobe it shows that the settings for printing allowed and visiable are set correctly.

I hope you guys have any suggestions on that problem or has an idea how to print a selecte ogc to a pdf document.


Thank you,
Martin



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