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 - printing layers/ocgs
  FAQ FAQ  Forum Search   Register Register  Login Login

printing layers/ocgs

 Post Reply Post Reply
Author
Message
MartinCS View Drop Down
Beginner
Beginner
Avatar

Joined: 27 Nov 12
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote MartinCS Quote  Post ReplyReply Direct Link To This Post Topic: printing layers/ocgs
    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:


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
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