Boa tarde!!
por nao ter conseguido solucao no topico anteriror resolvi buscar um codigo para
Converter Pdf em Jpg
achei essa função
Private Sub PrintAdobePDFToJPEG(strFilePath As String)
Dim objAdobeApp As Object
Dim itfAVDocument As Object
Dim itfPDDocument As Object
Dim nPages As Long
Dim objUDC As IUDC
Dim itfPrinter As IUDCPrinter
Dim itfProfile As IProfile
' Use Universal Document Converter API to change settings of converterd document
Set objUDC = New UDC.APIWrapper
Set itfPrinter = objUDC.Printers("Universal Document Converter")
Set itfProfile = itfPrinter.profile
' Adobe Acrobat API allow to print only on the default printer
objUDC.DefaultPrinter = "Universal Document Converter"
' Load profile located in folder "%APPDATA%\UDC Profiles".
' Value of %APPDATA% variable should be received using Windows API's
' SHGetSpecialFolderPath function. Or you can move default profiles into a
' folder you prefer.
itfProfile.Load ("PDF to JPEG.xml")
itfProfile.OutputLocation.Mode = LM_PREDEFINED
itfProfile.OutputLocation.FolderPath = "C:\Out"
itfProfile.PostProcessing.Mode = PP_OPEN_FOLDER
' Run Adobe Acrobat as COM-server
On Error Resume Next
Set objAdobeApp = CreateObject("AcroExch.App")
Set itfAVDocument = CreateObject("AcroExch.AVDoc")
' Open PDF document from file
If itfAVDocument.Open(strFilePath, "") = True Then
Set itfPDDocument = itfAVDocument.GetPDDoc()
nPages = itfPDDocument.GetNumPages()
' Print all pages of the document
Call itfAVDocument.PrintPagesSilent(0, nPages - 1, 0, True, True)
' Close the document
Call itfAVDocument.Close(True)
Set itfAVDocument = Nothing
Set itfPDDocument = Nothing
End If
' Close Adobe Acrobat Writer
Call objAdobeApp.Exit
Set objAdobeApp = Nothing
End Sub
estou usando no botao esse codigo
Private Sub COPIACAMINHOCOMPROVANTE_Click()
Dim bSuccess As Boolean
vPasta = Application.CurrentProject.path & "\COMPROVANTE PIX"
Set vJanelaPasta = Application.FileDialog(msoFileDialogFilePicker)
With vJanelaPasta
.Filters.Clear
.Filters.Add "Arquivos PDF", "*.PDF"
'.InitialFileName = vPasta
.AllowMultiSelect = False
.Title = "Selecione arquivo PDF"
End With
If vJanelaPasta.Show = -1 Then
vArquivo = vJanelaPasta.SelectedItems(1)
End If
Me.CODCONSORCAM = Forms!CONTROLEDECONSULTAS![Código]
vArqAtual = Mid(vArquivo, InStrRev(vArquivo, "\") + 1)
vPastaAtual = Mid(vArquivo, 1, Len(vArquivo) - Len(vArqAtual))
LocalArquivo = vPasta & "\" & "COMPROV PIX OPN" & Forms!CONTROLEDECONSULTAS![Código] & " DT-" & Format(Now, "dd-mm-yy") & ".Pdf"
LocalArquivo1 = vPasta & "\" & "NOP" & Forms!CONTROLEDECONSULTAS![Código] & ".JPEG"
FAZERCOPIA_Click
AtualizarPDF
'Aqui esta a chamada da Função
Call PrintAdobePDFToJPEG(LocalArquivo)
End Sub
ao usar exibe esta mensagem de erro
alguem pra ajudar?
por nao ter conseguido solucao no topico anteriror resolvi buscar um codigo para
Converter Pdf em Jpg
achei essa função
Private Sub PrintAdobePDFToJPEG(strFilePath As String)
Dim objAdobeApp As Object
Dim itfAVDocument As Object
Dim itfPDDocument As Object
Dim nPages As Long
Dim objUDC As IUDC
Dim itfPrinter As IUDCPrinter
Dim itfProfile As IProfile
' Use Universal Document Converter API to change settings of converterd document
Set objUDC = New UDC.APIWrapper
Set itfPrinter = objUDC.Printers("Universal Document Converter")
Set itfProfile = itfPrinter.profile
' Adobe Acrobat API allow to print only on the default printer
objUDC.DefaultPrinter = "Universal Document Converter"
' Load profile located in folder "%APPDATA%\UDC Profiles".
' Value of %APPDATA% variable should be received using Windows API's
' SHGetSpecialFolderPath function. Or you can move default profiles into a
' folder you prefer.
itfProfile.Load ("PDF to JPEG.xml")
itfProfile.OutputLocation.Mode = LM_PREDEFINED
itfProfile.OutputLocation.FolderPath = "C:\Out"
itfProfile.PostProcessing.Mode = PP_OPEN_FOLDER
' Run Adobe Acrobat as COM-server
On Error Resume Next
Set objAdobeApp = CreateObject("AcroExch.App")
Set itfAVDocument = CreateObject("AcroExch.AVDoc")
' Open PDF document from file
If itfAVDocument.Open(strFilePath, "") = True Then
Set itfPDDocument = itfAVDocument.GetPDDoc()
nPages = itfPDDocument.GetNumPages()
' Print all pages of the document
Call itfAVDocument.PrintPagesSilent(0, nPages - 1, 0, True, True)
' Close the document
Call itfAVDocument.Close(True)
Set itfAVDocument = Nothing
Set itfPDDocument = Nothing
End If
' Close Adobe Acrobat Writer
Call objAdobeApp.Exit
Set objAdobeApp = Nothing
End Sub
estou usando no botao esse codigo
Private Sub COPIACAMINHOCOMPROVANTE_Click()
Dim bSuccess As Boolean
vPasta = Application.CurrentProject.path & "\COMPROVANTE PIX"
Set vJanelaPasta = Application.FileDialog(msoFileDialogFilePicker)
With vJanelaPasta
.Filters.Clear
.Filters.Add "Arquivos PDF", "*.PDF"
'.InitialFileName = vPasta
.AllowMultiSelect = False
.Title = "Selecione arquivo PDF"
End With
If vJanelaPasta.Show = -1 Then
vArquivo = vJanelaPasta.SelectedItems(1)
End If
Me.CODCONSORCAM = Forms!CONTROLEDECONSULTAS![Código]
vArqAtual = Mid(vArquivo, InStrRev(vArquivo, "\") + 1)
vPastaAtual = Mid(vArquivo, 1, Len(vArquivo) - Len(vArqAtual))
LocalArquivo = vPasta & "\" & "COMPROV PIX OPN" & Forms!CONTROLEDECONSULTAS![Código] & " DT-" & Format(Now, "dd-mm-yy") & ".Pdf"
LocalArquivo1 = vPasta & "\" & "NOP" & Forms!CONTROLEDECONSULTAS![Código] & ".JPEG"
FAZERCOPIA_Click
AtualizarPDF
'Aqui esta a chamada da Função
Call PrintAdobePDFToJPEG(LocalArquivo)
End Sub
ao usar exibe esta mensagem de erro
alguem pra ajudar?