adobe / adobe/PDFServices.NET.SDK.Samples

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

Offen
#26 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
HTML
Sterne
47
Forks
23
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit dem bereitgestellten Beispielcode-Pfad bei FileRef.CreateFromStream und DocumentMergeOperation.Execute und vergleichen Sie ihn anschließend mit der Behandlung des IFormFile-Streams durch die .NET 7-Beispielanwendung. Erfassen Sie zuerst den vollständigen Fehler und die vollständigen Reproduktionsschritte; als erledigt gilt die Aufgabe, wenn der Fehler reproduziert und eine dokumentierte Korrektur oder ein bestätigtes SDK-Problem identifiziert wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
24/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.