简体   繁体   English

PDFClown .NET打开Windows资源管理器,而不指定路径

[英]PDFClown .NET Open a Windows Explorer instead of specifying path

Currently I have this test code 目前我有这个测试代码

    File file = new File();
    Document document = file.Document;
    Page page = new Page(document);

    document.Pages.Add(page);

    PrimitiveComposer composer = new PrimitiveComposer(page);
    composer.SetFont(new StandardType1Font(document, StandardType1Font.FamilyEnum.Courier, true, false), 32);
    composer.ShowText("Hello World!", new PointF(32, 48));

    composer.Flush();
    file.Save("test.pdf", SerializationModeEnum.Incremental);
    System.Diagnostics.Process.Start("explorer", System.IO.Directory.GetParent(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName).ToString());

How can I open a general windows explorer save as prompt instead of saving to the hard code path "test.pdf"? 如何打开常规Windows资源管理器另存为提示,而不是保存到硬代码路径“ test.pdf”? (In file.save() ) (在file.save()

Thanks 谢谢

Use SaveFileDialog for that: 为此使用SaveFileDialog

https://msdn.microsoft.com/en-us/library/sfezx97z(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/sfezx97z(v=vs.110).aspx

   SaveFileDialog saveFileDialog1 = new SaveFileDialog();  
   saveFileDialog1.Filter = "PDF File|*.pdf";  
   saveFileDialog1.Title = "Save PDF";  

   if(saveFileDialog1.ShowDialog() == DialogResult.OK)  
   {  
       file.Save(saveFileDialog1.FileName, SerializationModeEnum.Incremental);
   }  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在所有Open Explorer Windows的ListBox中获取路径 - Get Path in a ListBox of all Open Explorer Windows 从.NET在Windows资源管理器中打开WPD设备 - Open WPD Device in Windows Explorer from .NET 如果 Windows 资源管理器在特定路径打开,则不要创建新实例 - If Windows explorer is open at a specific path, do not create a new instance 从 .NET 以编程方式访问“打开方式”Windows 资源管理器菜单列表 - Programmatically access the “Open with” Windows Explorer menu list from .NET 在Windows资源管理器中打开Windows 7库 - Open a Windows 7 Library in Windows Explorer var di = new DirectoryInfo(path)引发异常,直到我第一次使用Windows资源管理器打开路径 - var di = new DirectoryInfo(path) throws exception until I use Windows Explorer to open the path for a first time 从Silverlight打开Windows资源管理器 - Open windows explorer from Silverlight 打开 Windows 资源管理器并执行搜索 - Open Windows Explorer and perform a search 单击Mozilla Firefox中的链接后,如何在Windows资源管理器中打开网络路径文件夹? - How to open a network path folder in windows explorer on click of link from Mozilla Firefox? 使用PDFClown(.net版本)列出嵌入字体 - List embedded fonts using PDFClown (.net version)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM