REDUZIR O TAMANHO DE ARQUIVOS PDF

EDSON.PEREIRA 01/06/2023 16:41:22
#501459
Olá, a todos!...
Alguém tem uma dica de como reduzir o tamanho de um arquivo PDF usando referencia Adobe Acrobat Pro.
estou fazendo um utilitário so falta isso pra terminar
desde já agradeço!
PROGRAMADORVBNET 01/06/2023 16:49:21
#501462
Olá , segue-se o link : https://tools.pdf24.org/pt/comprimir-pdf
EDSON.PEREIRA 01/06/2023 17:04:38
#501463
Alterado em 01/06/2023 20:54:55 mas este on-line, eu queria colocar no meu sistema.
ja tenho para unir varios PDF, o problema pra onde vai este arquivo não pode passar de 10

Dim OK As String, DelArquivo As String
Dim NumPages As Long, NumberOfPagesToInsert As Long
Dim myString As String, x As Integer
DelArquivo = App.Path & "\" & Me.Label1.Caption & "\" & UCase(PCase(Me.Label1.Caption) & "_PROCESSO_COMPLETO.PDF")
If Dir(DelArquivo) <> "" Then Kill DelArquivo 'exclua o arquivo, se existir

Set primaryDoc = CreateObject("AcroExch.PDDoc")
OK = primaryDoc.Open(Me.ListView2.ListItems(1).ListSubItems(1) & Me.ListView2.ListItems(1))
For x = 1 To Me.ListView2.ListItems.Count
myString = Me.ListView2.ListItems(x).ListSubItems(1) & Me.ListView2.ListItems(x)
NumPages = primaryDoc.GetNumPages() - 1
Set sourceDoc = CreateObject("AcroExch.PDDoc")
OK = sourceDoc.Open(myString)
NumberOfPagesToInsert = sourceDoc.GetNumPages
OK = primaryDoc.InsertPages(NumPages, sourceDoc, 0, NumberOfPagesToInsert, False)
OK = primaryDoc.Save(PDSaveFull, App.Path & "\" & Me.Label1.Caption & "\" & UCase(PCase(Me.Label1.Caption) & "_PROCESSO_COMPLETO.PDF"))
Set sourceDoc = Nothing
Next x
Set primaryDoc = Nothing
ListView1_Click

Sr. Adm não estou conseguindo colocar anexo imegem
EDSON.PEREIRA 02/06/2023 14:14:20
#501467
https://creator.pdf24.org/manual/11/#71-command-line
agora só falta estudar.
EDSON.PEREIRA 23/07/2023 13:32:54
#501604
Olá, a tudo!
Ainda estou procurando?
Achei este link https://developer.adobe.com/document-services/docs/overview/pdf-services-api/howtos/compress-pdf/#compress-pdfs-1 mas está em JAVA e .NET.
Até converti com programa Java to VB & C# Converter
Alguém sabre converte pra VB6

' Get the samples from https://www.adobe.com/go/pdftoolsapi_java_samples
' Run the sample:
' mvn -f pom.xml exec:java -Dexec.mainClass=com.adobe.pdfservices.operation.samples.compresspdf.CompressPDF

Public Class CompressPDF
' Initialize the logger.
Private Shared Logger As final

Public Shared Sub main(ByVal args() As String)

Try
' Initial setup, create credentials instance.
Dim credentials As Credentials = Credentials.servicePrincipalCredentialsBuilder().withClientId("PDF_SERVICES_CLIENT_ID").withClientSecret("PDF_SERVICES_CLIENT_SECRET").build()

' Create an ExecutionContext using credentials and create a new operation instance.
Dim executionContext As ExecutionContext = System.Threading.ExecutionContext.create(credentials)
Dim compressPDFOperation As CompressPDFOperation = CompressPDFOperation.createNew()

' Set operation input from a source file.
Dim source As FileRef = FileRef.createFromLocalFile("src/main/resources/compressPDFInput.pdf")
compressPDFOperation.setInput(source)

' Execute the operation
Dim result As FileRef = compressPDFOperation.execute(executionContext)

' Save the result at the specified location
result.saveAs("output/compressPDFOutput.pdf")

Catch ex As ServiceApiException
LOGGER.error("Exception encountered while executing operation", ex)
End Try
End Sub
End Class
Faça seu login para responder