Automatically open PDF after publishing using vb.net

I've successfully written code to publish a PDF, but what I would like to do is automatically open that PDF once it has been published.
I'm using Doc.SendStringToExecute("._-PUBLISH ", True, False, False) which opens explorer so that I can choose the DSD file. After selecting the DSD file the PDF is published, which is all fine, but this is where I hit a brick wall. Is there any way of automatically opening the PDF?

Following is DSD file generated.

[DWF6Version]
Ver = 1
[DWF6MinorVersion]
MinorVer = 1
[DWF6Sheet:S24_Cons-001]
DWG=C:\Users\Dan's HP Laptop\Desktop\S24_Cons.dwg
Layout=001
Setup=
OriginalSheetPath=C:\Users\Dan's HP Laptop\Desktop\S24_Cons.dwg
[DWF6Sheet:S24_Cons-002]
DWG=C:\Users\Dan's HP Laptop\Desktop\S24_Cons.dwg
Layout=002
Setup=
OriginalSheetPath=C:\Users\Dan's HP Laptop\Desktop\S24_Cons.dwg
[Target]
Type=6
DWF=C:\098\98313\SURVEY\EXPORT\98313AS-429A.pdf
OUT=C:\098\98313\SURVEY\EXPORT
LocationType=2
[SheetSet Properties]
NoOfCopies=1
PlotStampOn=FFALSEe
PromptForDwfName=FALSE
GenerateDwfName=FALSE
IncludeLayer=TRUE
[PdfOptions]
ConvertTextToGeometry=FALSE
LineMerge=FALSE
EmbeddedTtf = TRUE
ImageAntiAliasing=TRUE
JPEGImageCompression=TRUE
ExportHyperlinks=TRUE
VectorResolution=2400
RasterResolution=300
PdfA=0

Any help would be appreciated.

Dan

Comments

  • after the PDF is created, let say targetFilename=c:\files\myFile.pdf try the following code...

    Process p = new Process();
    p.StartInfo = new ProcessStartInfo(targetFilename);
    p.Start();
  • Thanks for your tip. I'll try this out.