adobe / adobe/PDFServices.NET.SDK.Samples

I am sending a stream from an IFormFile, but I am getting the following error

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
47
Forks
23
PR merge metrics
No merged PRs in 30d

Description

### Expected Behaviour

Generate PDF from docx in IFormFile

### Actual Behaviour
Error:
Captura de pantalla 2023-07-30 a la(s) 3 15 27 a m

### Reproduce Scenario (including but not limited to)
Captura de pantalla 2023-07-30 a la(s) 3 16 59 a m

#### Steps to Reproduce

#### Platform and Version
.NET 7 in macOS 13.5 with Apple Sillicon

#### Sample Code that illustrates the problem
```
// Initial setup, create credentials instance.
Credentials credentials = Credentials.ServicePrincipalCredentialsBuilder()
.WithClientId("")
.WithClientSecret("")
.Build();

ExecutionContext executionContext = ExecutionContext.Create(credentials);
DocumentMergeOptions documentMergeOptions = new DocumentMergeOptions(jsonObject, OutputFormat.PDF);
DocumentMergeOperation documentMergeOperation = DocumentMergeOperation.CreateNew(documentMergeOptions);

using var stream = new MemoryStream();
await file.CopyToAsync(stream);
FileRef source = FileRef.CreateFromStream(stream, CreatePDFOperation.SupportedSourceFormat.DOCX.GetMediaType());
documentMergeOperation.SetInput(source);

FileRef result = documentMergeOperation.Execute(executionContext);
await using Stream outputStream = PrepareOutputStream();
result.SaveAs(outputStream);
_logger.LogInfo("Moving this temporary file to output stream.");
```

#### Logs taken while reproducing problem

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.