how to create PDF/A using PDF Converter in Dev Mode

If you are a VFP developer and have any questions about using our products from VFP here is the place to post them.
Post Reply
johnz
Posts: 3
Joined: Tue Oct 21 2008

how to create PDF/A using PDF Converter in Dev Mode

Post by johnz »

I need example code for creating a PDF/A type file in a Visual Foxpro environment. I know this is a new feature and cannot find any example code and what options are required to make this happen.
Thanks !!!
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Re: how to create PDF/A using PDF Converter in Dev Mode

Post by Joan »

Hello,

Here is a sample VB code that generated PDF/A files from Word using the ActiveX interface of CDIntf. You can interpret it to VFP.

Code: Select all

Private Sub PrintPDFA_Click()
 
   ' Declare the Word application
    Dim wordApp As New Word.Application
    Dim WordDoc As Word.Document
    Dim Options As Long
    Dim SavePrinter As String
    Dim i As Integer
    Dim s As Integer
    i = 1
    
    ' initialize PDF printer and set it as default
    PDF = cdi.DriverInit(PDFprinter)       ' this is for the standard version
       
    If PDF = 0 Then
        MsgBox "Cannot initialize PDF printer"
        Exit Sub
    End If
    
     cdi.EnablePrinter strlicenseto, stractivationcode
     
    'Printer Handle
    MsgBox "The returned PDF Handler is: " & PDF
    
    'Set the default directory
    cdi.DefaultDirectory inputdir
    
    cdi.FileNameOptions NoPrompt + UseFileName
    
    'Set the default location of the output
    cdi.DefaultFileName outputdir + "PDA Printed from Word.pdf"
    
    ' Create PDFA files compatible with AR 7
    cdi.ImageOptions IO_OUTPUTPDFA + IO_XMPMETADATA         'IO_OUTPUTPDFA=8 AR7 IO_OUTPUTPDFA8=20 AR8
    cdi.SetDefaultConfig

    
    ' Open the word file
    wordApp.Visible = False
    SavePrinter = wordApp.ActivePrinter
    wordApp.ActivePrinter = PDFprinter
    Set WordDoc = Documents.Open(inputdir + "Testing Procedure Report.doc")

    EnablePrinter PDF, strlicenseto, stractivationcode
  
    WordDoc.PrintOut (False)
    wordApp.ActivePrinter = SavePrinter
    
   
    'Quit Word
     wordApp.Quit
    
    ' Free the used objects.
    Set Word.Global = Nothing
    Set wordApp = Nothing
    
    cdi.FileNameOptions 0

    cdi.DriverEnd

Hope this helps.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
johnz
Posts: 3
Joined: Tue Oct 21 2008

Re: how to create PDF/A using PDF Converter in Dev Mode

Post by johnz »

Thanks for that example.

I currently have imageoptions = 1
How would I add the above imageoptions value to my current command

Also,
I am not sure which output type will end up working PDF/A or PDF/X , is there a list of the each option explaining them ? Also do i need to set anything for metadata ?
sorry for all the questions
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Re: how to create PDF/A using PDF Converter in Dev Mode

Post by Joan »

Hello,

you can get these values from our Developers' documentation "Common Driver Interface 300.pdf"

If you don't have it please let me know.
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
johnz
Posts: 3
Joined: Tue Oct 21 2008

Re: how to create PDF/A using PDF Converter in Dev Mode

Post by johnz »

Joan,
could you please email me that pdf or send me a link to download it.
Thank You !!
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Re: how to create PDF/A using PDF Converter in Dev Mode

Post by Joan »

Hello,

Here are all the values of SetImageOptions and among them you will find the PDF/A values.

IO_NODUPLICATES Remove Duplicate Images 0x00000001
IO_DOWNSAMPLE Downsample high-resolution images 0x00000002
IO_CONVERTTOCMYK Convert RGB colors to CMYK 0x00000004
IO_OUTPUTPDFA Create PDF/A files that are Acrobat 7 compatible 0x00000008
IO_XMPMETADATA Add XMP metadata to PDF files(can be used independently of PDF/A) 0x00000010
IO_OUTPUTPDFA8 Create PDF/A files that are Acrobat 8 compatible 0x00000020
IO_NOPRECOMPRESSED Instructs GDI to send uncompressed images instead of PNG/JPEG images 0x00000040
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html

Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Post Reply