jooeyvh
jooeyvh
CC#
Created by jooeyvh on 2/2/2025 in #help
Problem storing iText7 pdf in a memoryStream
Nice I will explore QuestPDF deeper. Thank you👍
12 replies
CC#
Created by jooeyvh on 2/2/2025 in #help
Problem storing iText7 pdf in a memoryStream
thanks for that information I didn't know. In my particular case it won't be an issue but good to know for the future definitely. Have you used anything similar to iText that you could recommend?
12 replies
CC#
Created by jooeyvh on 2/2/2025 in #help
Problem storing iText7 pdf in a memoryStream
oh yeah of course 👍 that was the reason why it didn't work, I made some adjustments and added await to the UploadToBlobStorage method call. Thank you so much for all the help
12 replies
CC#
Created by jooeyvh on 2/2/2025 in #help
Problem storing iText7 pdf in a memoryStream
Right, my UploadToBlobStorage method looks like this, usually works fine
public async Task UploadToBlobStorage(MemoryStream pdfStream, string blobName)
{
pdfStream.Position = 0;
BlobServiceClient blobServiceClient = new BlobServiceClient(Environment.GetEnvironmentVariable("connectionString"));
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(Environment.GetEnvironmentVariable("containerName"));
await containerClient.CreateIfNotExistsAsync();
BlobClient blobClient = containerClient.GetBlobClient(blobName);

await blobClient.UploadAsync(pdfStream);
}
public async Task UploadToBlobStorage(MemoryStream pdfStream, string blobName)
{
pdfStream.Position = 0;
BlobServiceClient blobServiceClient = new BlobServiceClient(Environment.GetEnvironmentVariable("connectionString"));
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(Environment.GetEnvironmentVariable("containerName"));
await containerClient.CreateIfNotExistsAsync();
BlobClient blobClient = containerClient.GetBlobClient(blobName);

await blobClient.UploadAsync(pdfStream);
}
12 replies
CC#
Created by jooeyvh on 2/2/2025 in #help
Problem storing iText7 pdf in a memoryStream
Thanks a lot for this, it won't upload anything to the blob storage, however, it doesn't throw any weird errors except for those two you mentioned it always will throw. I will keep investigating why nothing shows up on the blob storage
12 replies