Overwrite PDFs with a new one

  • Filter
  • Time
  • Show
Clear All
new posts

  • Overwrite PDFs with a new one

    I save pdf reports as my parts serial number directly to my network. Operator scan a barcode in an input comment and I use variables for reporting and printing locations. I have a yes no comment asking of the part is a re test and if yes, it adds the system time at the end of the serial number to differentiate reports on my network.

    So I may have a report with a failing feature by 0.0001", operator then cleans the part thoroughly, maybe re calibrates the probes and re runs the same part using the same serial number. So when they do that, they say yes its a re test when prompted and then we get a new report with the added time hopefully passing this time.

    ex.ABC001.pdf which failed and then ABC001_12.30.pdf which may still be failed or passes if they are lucky.

    Is there a way for pcdmis to overwirte the previous serial number if the run the same serial number again? This would get rid of adding system time to the end of my report file names.

  • #2
    Can't say for certain because I'm not sure exactly what methods you're using here. But, if you're saving a pdf as a specific serial number, then shouldn't saving it again with the exact same number as the title just overwrite the previous one?

    If I were to try to save report.pdf in a location where a file called report.pdf already exists, it will just default to overwrite the old one. Try removing the time code off of the file name and just using the serial number and see if that gives the results you want.


    • #3
      you can use file/check to see if the file exists, if it does you can delete it at the beginning of the routine with file/delete command.

      ASSIGN/C_PATH="C:\PRODUCTION\yourpn\" + your_barcode_part_number_comment.input + ".PDF"


      • louisd
        louisd commented
        Editing a comment
        Note: I have else goto/continue1 command in there, otherwise you sometimes get an error message that will pop up, if i recall correctly it's something dumb like "file does not exist!".

      • acgarcia
        acgarcia commented
        Editing a comment
        works perfectly. Thanks.

    • #4
      Thanks. I will try it out.


      Related Topics