如何将现有的PDF“拉”入应用程序?

时间:2019-09-13 12:48:02

标签: c# wpf pdf

我目前在C#/ WPF中有一个应用程序,并且在 @Component public class CamelRoutesLoader { @Autowired private CamelContext camelContext; @Value("${camel-routes-filename:#{null}}") private String routesFilename; @PostConstruct private void loadRoutes() { if(routesFilename == null) { //error no file name } try { InputStream is = this.getClass().getClassLoader().getResource(routesFilename).openStream(); RoutesDefinition routes = ModelHelper.loadRoutesDefinition(camelContext, is); camelContext.addRouteDefinitions(routes.getRoutes()); } catch(Exception e) { //Impossible to load routes } } } 中有一个如何使用它的手册,我正在考虑添加一个按钮,单击该按钮可以打开手册...如何我这样做吗?

1 个答案:

答案 0 :(得分:1)

Process.Start(“ C:\ Temp \ yourname.pdf”);

将字符串“ C:\ Temp \ yourname.pdf”替换为要打开的pdf文件的路径和文件名。

这将导致pdf在系统默认的pdf应用程序中打开。

您将需要:-使用System.Diagnostics;