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;
Copy link to clipboard
Copied
Try the forum for this services.