Cancel
Showing results for 
Search instead for 
Did you mean: 

Extended Print Dialog API / Can't access to PrinterSettings

Legend
Legend

I wrote an API to print to a printer or PDF the Femap active view automatic, changed the Print Header, Print Footer and filename in case of PDF printing. I use in my API PDF995 printer driver (it's free, www.pdf995.com).

 

My problem is that I can't access to printer settings. I can add in Reference the System.Drawing.dll (2.0), but the followings will fail:

 

    Dim oldPrinter As String
    Dim oPS As System.Drawing.Printing.PrinterSettings
    Set oPS As New System.Drawing.Printing.PrinterSettings
    oldPrinter=oPS.PrinterName

Now I use my API without PrinterSettings and my Dialog looks like this:

 

Print (extended).jpg

I can set with first column of checkboxes to show or not show the file name, the active load set, constraint set and output case in the footer. With "Auto Letter" I change the last character of the Header according to Output Case (in case of Output Case=1 last character is "a", in case of Output Case=2 last character is "b", ...). I use Counter to PDF filename. I can change active Load Set, Constraint Set and Output Case with buttons (separately or simultaneously). I can refresh graphic window, print to active printer, print to PDF, rotate model, printer setup, page setup, make header and footer permanent.

My API use an Ini file (in KadP_Femap.zip), path is "d:\Home\Femap\KadP_Femap.ini" in Procedure "InitializePDF" (can be modified). The parameters are following:

 

Stop_end_Femap: when True, API stop with Message Box after printing.

pdf_iniFileName: full filename (with path) of PDF995.ini file.

pdf_OutputFolder_Femap: temporary output folder for PDF printing (see Output.zip in attachement)

PDF_Counter: API use to save the Counter value.

 

Best regards,

 

Peter Kaderasz