I find the DWG export macro for flattening an assembly file great, however I find it lacks the ability to export to PDF as well.
IPartDoc::ExportToDwg2 SOLIDWORKS API method allows to export selected flat pattern to DXF/DWG format. But this API doesn't allow to show the built in Cleanup dialog ...