Hello,
can Aspose PDF remove fonts from a document in order to reduce size? otherwise remove duplicate fonts?
Thanks
Hello,
can Aspose PDF remove fonts from a document in order to reduce size? otherwise remove duplicate fonts?
Thanks
Hi Paolo,
paoloponzano:can Aspose PDF remove fonts from a document in order to reduce size?
Hello,
excuse me …any news about this? I don’t know how to check on issue tracking system
Thanks
Hi Paolo,
Hi Paolo,
Please note that not all fonts can be removed/replaced with another, but a common functionality will be available in v7.3.
Hi Paolo,
[C#]
Document doc = new
Document(inFile);<o:p></o:p>
TextFragmentAbsorber absorber = new TextFragmentAbsorber(new TextEditOptions(TextEditOptions.FontReplace.RemoveUnusedFonts));
doc.Pages.Accept(absorber);
foreach (TextFragment textFragment in absorber.TextFragments)
{
textFragment.TextState.Font = FontRepository.FindFont("Courier New");
}
doc.Save(outFile);
The issues you have found earlier (filed as PDFNEWNET-32021) have been fixed in Aspose.Pdf for .NET 7.3.0.
hello,
does it remove duplicate fonts as well?
Thanks
excuse me…
maybe I’m doing wrong…this piece of code substutuites the font with one I define…but doesn’t remove unused font…is there a way of using it as I need?
Thanks
Hi Paolo,
Excuse me…maybe I’m expressing wrong myself…
I’m using this for concatinating file
PdfFileEditor editor = new PdfFileEditor();
editor.Concatenate(msArray, fileStream);
fileStream.Close();
Where should I put the TextFragment code?
Thanks
Hi Paolo,
paoloponzano:Excuse me.....maybe I'm expressing wrong myself...
I'm using this for concatinating file
PdfFileEditor editor = new PdfFileEditor();
editor.Concatenate(msArray, fileStream);fileStream.Close();
Where should I put the TextFragment code?Hi Paolo,
Thanks for your patience.
Please note that the approach shared earlier in which I have described the usage of TextFragment to replace the font for all text segments with a single font and hence it will remove the unused fonts but as per your current requirement to remove the unused/duplicate fonts while concatenating the PDF files, we need to further look into this matter where we can eliminate/remove the duplicate/unused fonts from PDF file. Can you please share some sample PDF files containing unused fonts so that we can further investigate this requirement while using those sample files.
We are sorry for your inconvenience.
Hello CodeWarrior,
just take a pdf that has a subset of font, concatenate it using aspose, the output will have the double of font…
Hi Paolo,
Thanks for the information.
I have tested the scenario where I have tired concatenating one of my sample PDF file with its own copy and as per my observations, the resultant file does not contain the double/duplicate font. I have tried concatenating PDF files using Aspose.Pdf for .NET 7.3.0.
Please note that I have tried using following two approaches to concatenate the PDF files but I am unable to find the font duplicate issue.
[C# - Aspose.Pdf.Document approach]
//open first document
Aspose.Pdf.Document pdfDocument1 = new Aspose.Pdf.Document(“TestKDL.pdf”);
//open second document
Aspose.Pdf.Document pdfDocument2 = new Aspose.Pdf.Document(“Copy of TestKDL.pdf”);
//add pages of second document to the first
pdfDocument1.Pages.Add(pdfDocument2.Pages);
//save concatenated output file
pdfDocument1.Save(“DoubleFont_output.pdf”);
[C# - Aspose.Pdf.Facades approach]
//create PdfFileEditor object
PdfFileEditor pdfEditor = new PdfFileEditor();
//concatenate files
pdfEditor.Concatenate(“TestKDL.pdf”, “Copy of TestKDL.pdf”, “DoubleFont_output_Facades.pdf”);
I would again request you to please share the sample PDF file which can help us in replicating this issue.
We are sorry for your inconvenience.
The issues you have found earlier (filed as PDFNEWNET-28353) have been fixed in Aspose.Pdf for .NET 7.6.0.