automatic generate pdf using shell code in C++ Code

来源:互联网 发布:淘宝店怎么添加客服号 编辑:程序博客网 时间:2024/05/08 20:32

-------------pictoPdf.sh--------------

#!/bin/bash

cd /home/kris/catkin_ws/src/imgpcl
convert 1.jpg 1.pdf

exit 0

--------imgpcl_sample.cpp-------

#include <stdlib.h>
int system(const char *string);
int main(){
  system("/home/kris/catkin_ws/src/imgpcl/pictoPdf.sh");
  return 0;
}

ps:

do not forget  " chmod +x  *.sh"

reference:

https://baozh.github.io/2013-11/how-to-call-shell-script-in-c-plus-plus-program/

http://blog.csdn.net/ddkxddkx/article/details/7019408

http://blog.csdn.net/yangruibao/article/details/7255787

0 0
原创粉丝点击