For the moment it's not possible to do it but it's in my to-do list together with font merging and substitution.
Best Regards,
Paulo Soares
-----Original Message-----
From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] On Behalf Of Luke Chambers
Sent: Friday, January 02, 2004 21:31
To: [EMAIL PROTECTED]
Subject: [iText-questions] Embedding fonts
I have 30 documents that I am concatinating. I need to embed the fonts but I would rather do it only to the final document than each individual.
�
Using the code below, is it possible to�embed�the Arial font to�the final�concatinated document?
�
Thank you,
LWC
�
�
�
�����
��ByteArrayOutputStream baosPDF = new ByteArrayOutputStream(); //
�
����������� try {
��������������� Document document = null;
��������������� PdfCopy� writer = null;
��������������� for(int f = 0; f < file_list.size(); f++) {
������������������� // we create a reader for a certain document
������������������� PdfReader reader = new PdfReader((String)file_list.get(f));
������������������� reader.consolidateNamedDestinations();
����reader.shuffleSubsetNames();
������������������� // we retrieve the total number of pages
������������������� int n = reader.getNumberOfPages();
������������������� System.out.println("There are " + n + " pages in " + (String)file_list.get(f));
�������������������
������������������� if (f == 0) {
����������������������� // step 1: creation of a document-object
����������������������� document = new Document(reader.getPageSizeWithRotation(1));
����������������������� // step 2: we create a writer that listens to the document
����������������������� //writer = new PdfCopy(document, new FileOutputStream(outFile));
����������������������� writer = new PdfCopy(document, baosPDF);
����������������������� // step 3: we open the document
����������������������� document.open();
������������������� }
������������������ // step 4: we add content
������������������� PdfImportedPage _page;
������������������� for (int i = 0; i < n; ) {
����������������������� ++i;
����������������������� _page = writer.getImportedPage(reader, i);
����������������������� writer.addPage(_page);
����������������������� System.out.println("Processed page " + i);
������������������� }
��������������� /*��� PRAcroForm form = reader.getAcroForm();
������������������� if (form != null)
����������������������� writer.copyAcroForm(reader);*/
������������������ // f++;
��������������� }
��������������� // step 5: we close the document
��������������� document.close();
����������� }
����������� catch(Exception e) {
��������������� e.printStackTrace();
����������� }
���
���
�response.setContentType("application/pdf");
�ServletOutputStream sos;
�sos = response.getOutputStream();
�baosPDF.writeTo(sos);
�sos.flush();
���
���
%>
</body>
</html>
"MMS <safeway.com>" made the following annotations.
------------------------------------------------------------------------------
Warning:
All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately.
==============================================================================
