Sub Test(strFile as string) dim oDoc as Object Dim strFilterSubName as String strUrl = ConvertToUrl( strFile ) oDoc = StarDesktop.loadComponentFromURL( strUrl, "_blank", 0, array(MakePropertyValue("Hidden",true))) ) Then strFilterSubName = "" If oDoc.SupportsService("com.sun.star.presentation.PresentationDocument") Then strFilterSubName = "impress_pdf_Export" ElseIf oDoc.SupportsService("com.sun.star.sheet.SpreadsheetDocument") Then strFilterSubName = "calc_pdf_Export" ElseIf oDoc.SupportsService("com.sun.star.text.WebDocument") Then terSubName = "writer_web_pdf_Export" ElseIf oDoc.SupportsService("com.sun.star.text.GlobalDocument") Then strFilterSubName = "writer_globaldocument_pdf_Export" ElseIf oDoc.SupportsService("com.sun.star.text.TextDocument") Then strFilterSubName = "writer_pdf_Export" lseIf oDoc.SupportsService("com.sun.star.drawing.DrawingDocument") Then strFilterSubName = "draw_pdf_Export" strFilterSubName = "math_pdf_Export" ElseIf oDoc.SupportsService("com.sun.star.chart.ChartDocument") Then strFilterSubName = "chart_pdf_Export" Else ' $pdf->Write(0, "This gh1223 is just a simple text");