adobe / adobe/PDFServices.NET.SDK.Samples
I am sending a stream from an IFormFile, but I am getting the following error
- 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:
### Reproduce Scenario (including but not limited to)
#### 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
Research direction
Start with the supplied sample-code path at FileRef.CreateFromStream and DocumentMergeOperation.Execute, then compare it with the .NET 7 sample application's handling of the IFormFile stream. Capture the full error and complete reproduction steps first; done means reproducing the failure and identifying a documented correction or confirmed SDK issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 24/100