Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: password protecting PDF/X-1a
Conf: (P-PDF) Developers, Msg: 141468
From: dolphinfreetuna
Date: 10/20/2005 01:00 AM

Hey All

I am currently using Adobe PDF Library 6.11 to secure PDF files using a password. This is fine and dandy until a PDF/X-1a comes along (or any PDF/X file for that matter). When I try to do the password protection on one of those files, I get an Access Violation exception when I call PDDocSave(). Here is how the method is currently written:

void MyPDFLib::SecurePDF(PDDoc pdDoc)
{
PDDocSetNewCryptHandler(pdDoc, ASAtomFromString("Standard"));

StdSecurityDataRec* volatile secData = (StdSecurityDataRec*) PDDocNewSecurityData (pdDoc);
secData->size = sizeof(StdSecurityDataRec*);
secData->newOwnerPW = true;
secData->hasOwnerPW = true;
strcpy(secData->ownerPW, password);
secData->perms = pdPermOpen;
secData->keyLength = 16;

PDDocSetNewSecurityData (pdDoc, (void*) secData);
PDDocSetFlags(pdDoc, PDDocRequiresFullSave);
ASPathName asPathName = ASFileSysCreatePathName(ASGetDefaultFileSys(), ASAtomFromString("Cstring"), path, 0);
PDDocSave(pdDoc, PDSaveForceIncremental /*PDSaveFull*/, asPathName, ASGetDefaultFileSys(), NULL, NULL);
}

I don't particularly care if I break the PDF/X stuff (I'm not even sure if PDF/X supports password protection), all I want to do is allow the file to be viewed and look more or less like it does before securing it. I realize that PDF/X is based on 1.3 and PDF Library 6.11 writes PDF 1.5. Any ideas?

TIA
Frank

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.