Skip to main content
14-Alexandrite
July 4, 2024
Question

Finding and Fixing a Corrupted PDF File in SQL Database via EPM Document

  • July 4, 2024
  • 2 replies
  • 2376 views

There is a PDF file related to a CAD document, but this PDF file is corrupted. Since there is no API available, we cannot update the file with the correct version. Therefore, how can I find this PDF file in the SQL database via the EPM document? If I want to find and fix the file, which table should I use? Could you help me with this?

2 replies

MarcoTosin
21-Topaz I
21-Topaz I
July 4, 2024
ozclkonur14-AlexandriteAuthor
14-Alexandrite
July 4, 2024

Yes, by following the document's path, I found the location of the corrupted PDF file, but I do not have access to the file path. Therefore, I am unable to make changes. My goal is to create a mini application to replace the corrupted file. Is there an API or another method you know of to upload a new file with the same name and replace the old file?

MarcoTosin
21-Topaz I
21-Topaz I
July 4, 2024
joe_morton
18-Opal
18-Opal
July 8, 2024

How is the PDF related? Is it a Representation/Annotation? If so, you should be able to make a New Representation, then delete the old one. It's not advisable to directly replace files in the SQL database. 

 

Any idea how the PDF file got corrupted in the first place? Is this happening a lot on your system that you feel the need to make a utility for it? That's the bigger concern for me.

ozclkonur14-AlexandriteAuthor
14-Alexandrite
July 10, 2024

Initially, the PDF file doesn't appear corrupted, but the issue arises when the user changes the sheet number within the PDF. Since the user isn't fully aware of what a sheet represents, they mistakenly believe they are changing the page sequence number. Consequently, this can lead the user to perceive the PDF as corrupted.

 

I can resolve this issue by aligning the updated sheet number with the page sequence number and notifying the user accordingly. However, this solution only applies within the application. Because we haven't corrected the actual PDF file, Windchill continues to display it with the old sheet and page numbers. While the PDF I send to the user privately may be correct, it may not reflect accurately within Windchill.