@asad.ali asad - Appreciate your prompt response. To provide more information – yes we have installed all the required fonts as in referred previous support thread and we tested and observed that the TIFF to PDF conversion worked fine.
For your ease of reference, below are the fonts we installed
image.png (17.4 KB)
Per your suggestion, I checked the PDF properties and found that it’s using “Arial (Embedded Subset)” TrueType fonts (see blow). Which I believe we have already installed (see highlighted fonts TTF file in above screen pic)
image.png (14.8 KB)
But still converted PDF is having only blank page. I have no idea why?
I see you have mentioned to install “All Windows Fonts” when you say
As mentioned in referred thread, all windows fonts needs to be installed in the system where you are generating PDF files
-
Do we really need to install all (every) fonts available under “C:\Windows\Fonts” directory?
-
Are the subset of fonts installed currently by us not sufficient? (OR) installed subset of fonts could be an issue that converted PDF document having only blank pages?
I looked into other similar issues related to ASPOSE.PDF library “Converting TIFF To PDF Generated Blank Pages” but none them are helpful for me.
I am using below code (C#) for the conversion process. Do you see any issues with the implemented code
// Set Fonts Directory If Directory Exists
if (System.IO.Directory.Exists(Constants.ASPOSE_PDF_FONTS_DIRECTORY))
{
Aspose.Pdf.Text.FontRepository.Sources.Add(new Aspose.Pdf.Text.FolderFontSource(Constants.ASPOSE_PDF_FONTS_DIRECTORY));
}
Aspose.Pdf.Document pdf = new Aspose.Pdf.Document();
//Convert Tiff document image into bytes stream.
using (var ms = new System.IO.MemoryStream(ConfirmationDocument))
{
// Converting bytes into Image from the (image bytes)
System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
//Pass the Image for converion into PDF
System.Drawing.Bitmap myimage = new System.Drawing.Bitmap(returnImage);
// Convert multi page or multi frame TIFF to PDF
System.Drawing.Imaging.FrameDimension dimension = new System.Drawing.Imaging.FrameDimension(myimage.FrameDimensionsList[0]);
int frameCount = myimage.GetFrameCount(dimension);
for (int frameIdx = 0; frameIdx <= frameCount - 1; frameIdx++)
{
Page sec = pdf.Pages.Add();
myimage.SelectActiveFrame(dimension, frameIdx);
var currentImage = new System.IO.MemoryStream();
myimage.Save(currentImage, System.Drawing.Imaging.ImageFormat.Tiff);
Aspose.Pdf.Image imageht = new Aspose.Pdf.Image();
imageht.ImageStream = currentImage;
sec.Paragraphs.Add(imageht);
}
//Convert/Saving file into PDF Format
using (var stream = new System.IO.MemoryStream())
{
pdf.Save(stream, Aspose.Pdf.SaveFormat.Pdf);
//Converting Pdf File To Bytes
byte[] weFaxPdfDocumentBytes = stream.ToArray();
return weFaxPdfDocumentBytes;
}
ASPOSE.PDF version 20.3.0
Sample TIFF Image - You can use any multi-page TIFF image as sample
Extra Note: We are receiving byte[]
of the TIFF image and converting that to PDF byte[]
which is getting saved to external file storage.
OS Platform: Non Windows PCF Server (Ubuntu / Linux)
License: Confirmed and we are using a valid license only for ASPOSE.TOTAL For .NET (Latest Version).
Please help on this. I am trying to work on a critical issue at my end and kind of held up because of this. Let me know if you need any other information from my end?
Another Question: Can you please provide me a sample C# code to convert multi-page TIFF image to PDF.
Waiting for a early response from your end. Thank You.