

Since it's allocated, you need to release it. But if you want to do it in this direction you need to add the init call. I'd suggest doing the toll-free bridging in the other direction, creating a CFMutableData and then casting it to pass it to the PDFDocument. The NSMutableData object has to be initialized, not just allocated. Consider at least adding a return statement after that assert? Lets figure out what we want to do on failure. I'd suggest just the ASSERT for now, but that's even worse since we'll get an unused variable warning in a deployment build.

The ASSERT inside an if statement is not a good style. The converter, provider, and consumer all need to be released after the call to CGPSConverterConvert so they don't leak. We always use 0 instead of NULL - a debatable coding guidelines, but one I'd like you to follow.
#Windows convert ps to pdf code#
If you want to write a FIXME comment about them, that's OK, but we don't check in ifdef'd or commented-out code as a rule. Please don't check in the commented-out MIME types. That's one of our standards although might not be mentioned in our coding standards document at the moment (and should be). That way the Obj-C source file serves as a check that the header "stands alone". In WebPostScriptRepresentation.m, it's important that WebPostScriptRepresentation.h is the first file imported.
#Windows convert ps to pdf pdf#
They are closely related and tied to the PDF classes and so should share the same group in Xcode. I don't think these new files should go into a different "group" than PDF. I believe what you're really asking is: "What should the representation class do if there's a failure?" That leads to the questions:Ģ) What do we want the user to see if it does fail? > - Is there a better way to check the value of 'success'? > issue (backward compatibility with 10.3)? > - The CGDataConsumerCreateWithCFData() call was added in 10.4. I think there are some missing release calls. > references that I should in the PS-to-PDF code? Specifically, am I using > - Am I doing anything stupid with the Core Graphics APIs or not releasing

This first cut seems pretty neat, though, so no reason to redo it. > conditionalize the PS-to-PDF conversion (not very OO-design-worthy, though)?Ĭombining into a single class might be the right thing to do, since we're planning on changing around the whole representation/view thing later. > Should I create a base class for them? Or combine them into a single class and > finishedLoadingWithDataSource() method. > WebPostScriptRepresentation.h/m, changed the class names, and added code to the I basically copied WebPDFRepresentation.h/m to
