• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Jul 25, 2023 Jul 25, 2023

Copy link to clipboard

Copied

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

Views

68

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Try the forum for this services.

Votes

Translate

Translate

Report

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