Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I want to export pdf but i'm having a problem because the code i'm using print the pdf and export it. I only want to export....
Here is the code:
set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", "E:\util\MailQV\Cohortes.PDF", "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
ActiveDocument.PrintReport "RP01", "QlikviewPDF", false
set WSHShell = nothing
Thanks!!
I used following code. I am using PDF-XChange 3.0 pdf writer. Its working fine as far as pdf generation is concerned. But it pops up for save as dialog which i dont want. I want the generated pdf get saved automatically.I need to get this through on HIGHEST PRIORITY.
Please bump up with ideas.
sub printRP01
printReportPDF "C:\Temp\18T.pdf"
ActiveDocument.GetApplication.Sleep 2000
ActiveDocument.PrintReport "RP01", "PDF-Xchange 3.0"
ActiveDocument.GetApplication.Sleep 10000
end sub
'===========================================================================
Function printReportPDF(pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-Xchange 3.0\Drivers\Control\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-Xchange 3.0\Drivers\Control\BypassSaveAs", "1", "REG_SZ"
Set WSHShell = nothing
End function
I also discovered that -
1. calling the function printReportPDF is not making any difference.
It is as good as not called that function. Where am I going wrong??
2. ActiveDocument.PrintReport "RP01", "PDF-Xchange 3.0" this is the only code of line that is responsible for pdf generation and because of which SAVE AS dilogue pops up. Then what is the use of printReportPDF function?
s.fiemazzo wrote:
Sunil Jain ha scritto:
Dear Glenn,
I get following error whem using your code.
ActiveX component can't create object: 'PDFCreator.clsPDFCreator'
Regards
Sunil;
Hi, i have your same problem, how do you resolve it?
thanx
I'm having this same problem, did anyone ever solve it?
Hi All,
i have tried both PDFCreator and FreePdfXP, but i recive everytime save dialog.
I need to give the file name and save it automaticly.
Regards
Peyman
Hi there,
Try this with PDFCreator
'Create instance of PDFcreatore
Set PDFCreator = CreateObject("PDFCreator.clsPDFCreator")
ReportID = "RP04" 'Set report
vName = "thisisapdftest.pdf" 'Name of output pdf
PDFCreator.cStart("/NoProcessingAtStartup")
PDFCreator.cOption("UseAutosave") = 1 ' Enable autosave
PDFCreator.cOption("UseAutosaveDirectory") = 1 ' Use a specific save directory
PDFCreator.cOption("AutosaveDirectory") = "c:\tmp"'ActiveDocument.getVariable("TempPath").GetContent.String ' Set autosave directory
PDFCreator.cOption("AutosaveFormat") = 0 ' Use PDF file type (.PDF extension)
PDFCreator.cOption("AutosaveFilename") = vName ' set the filename, optionally you can get the Caption of the object and use it as Filename
PDFCreator.cPrinterStop = FALSE
'Export to PDF File
ActiveDocument.PrintDocReport ReportID, "PDFCreator"
Regards
Hi,
Did you ever solve your problem. I tried bullzip and had working code but the output pdf generated errors after being sent by mail so I have decided to go with PDF-Xchange:
Right now i have this:
....more code above
ActiveDocument.PrintReport(vReport), "PDF X-Change 3.0", false 'Printreport
'the report will go to a folder, now we have to rename
ActiveDocument.GetApplication.Sleep 3000
renamePDF vSup.String
endsub
sub renamePDF (vSup)
'File paths
Source = "C:\Qlikview Printing.pdf"
DestinationLocation = "C:\"
DestinationFileName = "renamed.pdf"
Destination = DestinationLocation & DestinationFileName
'Creating the file system object
Set ObjFso = CreateObject("Scripting.FileSystemObject")
'Moving the file
ObjFso.MoveFile Source, Destination
end sub
I would like to be able to set the "Save as" property in script, instead of doing it in the printer settings, did you ever solve it? I'm using PDF X-Change 3.0
Thanks!