[ Dacex @ 19.08.2010. 01:24 ] @
Imam problem trebam da pomoću vb6 prebacim wordov dokumenat u pdf dokument. Na koji način to radite? Bilo kakva pomoć je dobrodošla :) Hvala unapred! |
[ Dacex @ 19.08.2010. 01:24 ] @
[ t.marko016 @ 19.08.2010. 07:04 ] @
[ unisoft @ 19.08.2010. 08:44 ] @
Eboga zivot potrudi se malo i dobices mnogo odgovora bez tudje pomoci, a i ova tema vec postoji.
Kucaj na googl-u Creating PDF files in Visual Basic 6 i kao rezultat dobices mnogo sajtova na kojima pise kako se to radi. Najlaksa opcija ti je kupovina ActiveX kontrole koja prebacuje dokumente u PDF. [url=]http://www.cete.com/Products/Dynamic_PDF_COM_ActiveX_Products.csp?gclid=CKqL9LiExaMCFQM9ZgodY1w8YQ[/url]. [ djvlajko @ 27.08.2010. 15:18 ] @
Moras imati instaliran Acrobat distiller (pojavice se kao stampac). Posle toga, ova funkcija ce ti kreirati PDF fajl izabranog naziva. Parametri su (sem prvog), Word dokument od koga se pravi PDF i naziv PDF (sa putanjom) Code: Public Function DOC2PDF(wWordApp As Word.Application, WordDoc As Word.Document, sPDFFile As String) On Error GoTo Greska Dim Fso ' As FileSystemObject Dim sPrevPrinter ' As String Dim oDistiller ' As PDFDistiller.PDFDistiller.1 Set Fso = CreateObject("Scripting.FileSystemObject") Set oDistiller = CreateObject("PDFDistiller.PDFDistiller.1") If oDistiller Is Nothing Then MsgBox "Greška : PDF dokument se ne može kreirati. Adobe Acrobat Distiller nije dostupan", vbCritical, "GREŠKA" GoTo Kraj End If sTempFile = Fso.GetSpecialFolder(TemporaryFolder) + "\" + Fso.GetTempName() ' Remember current active printer sPrevPrinter = wWordApp.ActivePrinter wWordApp.ActivePrinter = "Acrobat Distiller" ' Print the Word document to the Acrobat Distiller - ' will generate a postscript (.ps) (temporary) file wWordApp.ActiveDocument.PrintOut False, , , sTempFile wWordApp.ActivePrinter = sPrevPrinter ' Distill the postscript file to PDF oDistiller.FileToPDF sTempFile, sPDFFile, "Print" ' Set oDistiller = Nothing ' Delete the temporary postscript file... Fso.DeleteFile (sTempFile) ' Set fso = Nothing GoTo Kraj Greska: MsgBox "Greška u kreiranju PDF dokumenta", vbInformation, "GREŠKA" Kraj: Set oDistiller = Nothing Set Fso = Nothing End Function Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|