I'm sending this email because I'm trying to convert
 programmatically(C#) a PDF file that exists in a certain folder, to 
PDF/A format.
I've made some tries but with almost no success...

The best I've got was the creation of an empty file, using the following code:
        private void button1_Click(object sender, EventArgs e)
        {            try            {
                string fileToConvert = Path.GetTempPath() + "test.pdf";         
       
                Document doc = new Document();                PdfWriter writer 
= PdfWriter.GetInstance(doc, new FileStream(fileToConvert, FileMode.Create));
                writer.PDFXConformance = PdfWriter.PDFA1B;                      
          doc.Open();
                            BaseFont bf = 
BaseFont.CreateFont(Path.GetTempPath() + "arial.ttf", BaseFont.WINANSI, true);
                iTextSharp.text.Font f = new iTextSharp.text.Font(bf);          
      doc.Add(new Paragraph("TEST", f)); 
                               writer.CreateXmpMetadata();                
doc.Close();
                writer.Close();            }            catch 
(iTextSharp.text.DocumentException dex)
            {                MessageBox.Show(dex.Message);            }
            catch (Exception ex)            {                
MessageBox.Show(ex.Message);
            }        }

Can
 anyone send me a solution/method to do what I need? Pick a PDF file and
 convert it to PDF/A without loosing the original PDF content?
At least, can you help me doing something like create a new PDF file from an 
existing one, adding a new page to it with a certain sentence, using the 
objects PdfWriter and Document.
This way I could understand the usage/relation/functionality of it..


Hope someone can help me because is very important for my project.

Best regards,

G.V.
                                                                                
  
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to