Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

unable to delete the source file after using this method FileRef.CreateFromLocalFile(filePath)

New Here ,
Jul 25, 2023 Jul 25, 2023

I try to convert Html to Pdf using Adobe.PDFServicesSDK, the Pdf is got generated but, when I try to delete the html file its showing like it's opened in another process.
FileRef source = FileRef.CreateFromLocalFile(filePath);
the above method is not disposing. and how to delete the filePath.

below I added the code I got from the Adob github page.
please help me to resolve this issue. 

 

 

Credentials credentials = Credentials.ServicePrincipalCredentialsBuilder()
.WithClientId("#")
.WithClientSecret("#)
.Build();

//Create an ExecutionContext using credentials and create a new operation instance.
Adobe.PDFServicesSDK.ExecutionContext executionContext = Adobe.PDFServicesSDK.ExecutionContext.Create(credentials);
CreatePDFOperation htmlToPDFOperation = CreatePDFOperation.CreateNew();


// Set operation input from a source file.
FileRef source = FileRef.CreateFromLocalFile(filePath);

htmlToPDFOperation.SetInput(source);

// Provide any custom configuration options for the operation.
SetCustomOptions(htmlToPDFOperation);
String outputFilePath = CreateOutputFilePath();

result.SaveAs(outputFilePath);
return outputFilePath;





TOPICS
Acrobat SDK and JavaScript
185
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 25, 2023 Jul 25, 2023
LATEST

Try the forum for this services.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines