PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

How to copy fonts from many input files to one output File
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3682
Page 1 of 1

Author:  BadBoy [ Wed Nov 01, 2017 6:05 am ]
Post subject:  How to copy fonts from many input files to one output File

Hi, all!
I want to split many pdf documents to many pdf, but merge them by page size.
and i have a problem with fonts. in my screan pdf documet looks good, but when i print it some of font looks bad on paper (look attach).
how can i copy from input documents all fonts? Or what i can do, to solve this problem?
I try different printers and different computers. from the original file this paper printed ok.
Code:
  foreach (string file in FileList)
            {
               PdfDocument doc = PdfReader.Open(file, PdfDocumentOpenMode.Import);
               for (int i = 0; i < doc.Pages.Count; i++)
                {
                    var page = doc.Pages[i];
                    int height = (int)page.Height.Millimeter;
                    int width = (int)page.Width.Millimeter;
                    string fName = height + "x" + width;
                    string fullFilePath = path + "\\" + textBox1.Text + "\\" + fName + ".pdf";
                    PdfDocument ndoc;
                    try
                    {
                         ndoc = PdfReader.Open(fullFilePath, PdfDocumentOpenMode.Modify);
                    }
                    catch
                    {
                        ndoc = new PdfDocument();
                    }

                    PdfPage inpage = ndoc.AddPage(page);
                    ndoc.Save(fullFilePath);
                    }
             }
}
PdfPage inpage = ndoc.AddPage(page);
ndoc.Save(fullFilePath);

when I try attach pdf file "forum" tell me :"its a invalid image" (((
Please, Help. name of font: "G OldStyle TType A".
this problem where with other fonts, but not all.

Attachments:
File comment: after print
AfterSplitPrint.jpg
AfterSplitPrint.jpg [ 116.91 KiB | Viewed 4440 times ]

Author:  TH-Soft [ Wed Nov 01, 2017 7:46 am ]
Post subject:  Re: How to copy fonts from many input files to one output Fi

BadBoy wrote:
when I try attach pdf file "forum" tell me :"its a invalid image" (((
You did read this, didn't you:
viewtopic.php?f=2&t=832

Author:  BadBoy [ Wed Nov 01, 2017 10:31 am ]
Post subject:  Re: How to copy fonts from many input files to one output Fi

PDFsharp.1.50.4619-beta4c, windows Forms, NuGet Package

Attachments:
File comment: after my program. printing bad
AfterSplit.zip [109.9 KiB]
Downloaded 287 times
File comment: Original pdf with font. printing good.
Original.zip [111.24 KiB]
Downloaded 332 times

Author:  BadBoy [ Tue Nov 21, 2017 7:57 am ]
Post subject:  Re: How to copy fonts from many input files to one output Fi

Please, help. I still dont find an answer. :oops:

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/