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

Merge two pdfs together and French does not display properly
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2777
Page 1 of 1

Author:  tangsabrina [ Thu Mar 27, 2014 7:12 pm ]
Post subject:  Merge two pdfs together and French does not display properly

Hi, Support:

I have a piece of C# code will merge two PDFs together.

there is nothing funcy, Open the first pdf in import mode, and insert each page into the second pdf. Eventually and save the pdf in a new pdf.

However, if my original pdf has some french characters, The new pdf can not display the french properly. Here is the code.

PdfDocument inputDocument1 = CompatiblePdfReader.Open(filename1, PdfDocumentOpenMode.Import); // first pdf to merge to second
PdfDocument inputDocument2 = CompatiblePdfReader.Open(filename2, PdfDocumentOpenMode.Modify); // second pdf to accept the merged pdf
PdfDocument origDocument2 = CompatiblePdfReader.Open(filename2, PdfDocumentOpenMode.InformationOnly); // final generated combined pdf

PdfDocument outputDocument = (PdfDocument)inputDocument2;

//the rest just read the first pdf page and insert it

foreach (PdfPage pageDoc1 in inputDocument1.Pages)
{
outputDocument.InsertPage(pageNo, pageDoc1);
}


however, the final document can not display french properly. see the attachment.

Attachments:
french.png
french.png [ 217.82 KiB | Viewed 8714 times ]

Author:  () => true [ Sat Mar 29, 2014 6:49 am ]
Post subject:  Re: Merge two pdfs together and French does not display prop

Hi!
tangsabrina wrote:
The new pdf can not display the french properly.
I think the PDF files will be needed to replicate the problem.

PDFsharp was developed in Germany - and if German text works properly, French text also will. There is no general problem with French.

Author:  tangsabrina [ Mon Mar 31, 2014 4:10 am ]
Post subject:  Re: Merge two pdfs together and French does not display prop

() => true wrote:
Hi!
tangsabrina wrote:
The new pdf can not display the french properly.
I think the PDF files will be needed to replicate the problem.

PDFsharp was developed in Germany - and if German text works properly, French text also will. There is no general problem with French.


Sorry, I am just newbie and does not really catch your idea.

Can you explain a bit more the PDF files willbe needed to replicate the problem? how can I do that? Merge PDFs using other software to test if it can display French or not? I used BIPubisher tool and merged two PDFs, the French works well.

Do I need any special Package for French Language?

Thanks,

Author:  () => true [ Mon Mar 31, 2014 6:08 am ]
Post subject:  Re: Merge two pdfs together and French does not display prop

tangsabrina wrote:
Can you explain a bit more the PDF files willbe needed to replicate the problem?
We cannot investigate this problem without PDF files and without sample code that allows us to reproduce the problem.

See also:
viewtopic.php?p=2094#p2094
(especially the section about SSCCE)

Are you sure the PDF files are displayed correctly before they are being merged?

Author:  dheijl [ Mon Mar 31, 2014 1:30 pm ]
Post subject:  Re: Merge two pdfs together and French does not display prop

It looks like your input documents contain UTF8 text, while your outputdocument tries to render this text in an 8-bit codepage like iso-latin1.

Danny

Author:  tangsabrina [ Thu Apr 03, 2014 5:54 pm ]
Post subject:  Re: Merge two pdfs together and French does not display prop

() => true wrote:
tangsabrina wrote:
Can you explain a bit more the PDF files willbe needed to replicate the problem?
We cannot investigate this problem without PDF files and without sample code that allows us to reproduce the problem.

See also:
viewtopic.php?p=2094#p2094
(especially the section about SSCCE)

Are you sure the PDF files are displayed correctly before they are being merged?


Yes, the original PDF files are displayed correctly.

I had tried attached the two pdfs and the code. but the size is quite big and do not allow me to attach them. how can I give them to you?

SEE THE PAGE 12 IN THE PDF,

the code is quite large. I do not think you need to understand the logic quite a lot.

Thanks very much.

Author:  tangsabrina [ Thu Apr 03, 2014 5:55 pm ]
Post subject:  Re: Merge two pdfs together and French does not display prop

dheijl wrote:
It looks like your input documents contain UTF8 text, while your outputdocument tries to render this text in an 8-bit codepage like iso-latin1.

Danny



then, what should I do to fix this? Is there any place I can set up the encoding method?

Thanks.

Author:  Thomas Hoevel [ Mon Apr 07, 2014 9:17 am ]
Post subject:  Re: Merge two pdfs together and French does not display prop

tangsabrina wrote:
SEE THE PAGE 12 IN THE PDF
Which PDF?

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