bugfix: sub strings only in basename to create output pdfs.