Skip to main content
Participant
March 11, 2024
Question

Error compress pdf

  • March 11, 2024
  • 0 replies
  • 145 views

When I made the example give me this error "Error response received for the request: No se puede enviar contenido textual con este tipo de verbo."}

 

This is my code 

// Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
CompressPDFOperation compressPDFOperation = CompressPDFOperation.CreateNew();

// Set operation input from a source file.
FileRef sourceFileRef = FileRef.CreateFromLocalFile(@"C:\\Users\\josec\\Desktop\\66ce2f72-9514-4aa8-ad65-41e98d360b37LotePolizas.pdf");
compressPDFOperation.SetInput(sourceFileRef);

// Build CompressPDF options from supported compression levels and set them into the operation
CompressPDFOptions compressPDFOptions = CompressPDFOptions.CompressPDFOptionsBuilder()
.WithCompressionLevel(CompressionLevel.LOW)
.Build();
compressPDFOperation.SetOptions(compressPDFOptions);


// Execute the operation.
FileRef result = compressPDFOperation.Execute(executionContext);

// Save the result to the specified location.
result.SaveAs(compressStream);

This topic has been closed for replies.