Start a New Discussion Ask a New Question

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Leading characters in output filename
  • Hi

    I am using below code to set PDFCreator settings and then I am programmatically printing the MS Access report to PDFCreator printer. The problem is that the generated PDF files have  ‘c__’ prefixed to their filenames which is ruining the filenames. How can I get rid of the preceding ‘c__’ from the output filenames please?

    Thanks

    Regards


        Set pdfjob = New PDFCreator.clsPDFCreator
        With pdfjob
            If .cStart("/NoProcessingAtStartup") = False Then
                MsgBox "Can't initialize PDFCreator.", vbCritical + _
                        vbOKOnly, "PrtPDFCreator"
                GoTo fexit
                'Exit Function
            End If
            .cOption("UseAutosave") = 1
            .cOption("UseAutosaveDirectory") = 1
            .cOption("AutosaveDirectory") = sPDFPath
            .cOption("AutosaveFilename") = sPDFName
            .cOption("AutosaveFormat") = 0    ' 0 = PDF
            .cClearCache
        End With

  • Hi,

     

    you can enable substitution options in the PDFCreator GUI, substitute "c__  = ".

    You can also take a look at the ShowPrintJobs.vbs example located in the COM folder (in your PDFCreator path) and see how cOutputFilename can be used.

     

    regards,

     

    Robin

    Robin
    Team pdfforge
  • Hi Robin

    Many thanks. I tried substitution but no luck. Also did not find a ShowPrintJobs.vbs file in the COM folder. I even searched on cOutputFilename on the whole of PDF Creator folder and this file did not come up. Is it possible to provide the relevant part of code that handles setting of output file name?

    Many Thanks

    Regards
     

  • The full PDFCreator source (for v1.4.1) is available here: http://sourceforge.net/projects/pdfcreator/files/PDFCreator/PDFCreator%201.4.1/ if you wanted to poke around it in the mean time.

  • Hello,

    this is a bit strange as setting the AutosaveFilename should lead to a proper filename. Can you debug this and tell me what the contect of the sPDFName variable is?

    kind regards,
    Philip

    Philip
    Team pdfforge
  • Hi Philip

    Many thanks for the tip. The original filename contains the path c:\ which was being converted to c__. Sorry, silly me.

    Thanks

    Regards