このコードはあります。これは、だから私は、ユーザーが、彼らが必要とするものは何でも、ファイルパスに2つの文字列を変更し、代わりにinput
またはoutput
ファイルのコマンドにそれを置きたいC++のシステム関数でコマンドの特定の部分を変更するには
#include <iostream>
using namespace std;
int main() {
string inputfile = "input.pdf";
string outputfile = "output.tiff";
cout << "paste path of pdf to convert" << endl;
cin >> inputfile;
cout << "type the path of the output file with the correct extension ie png jpeg or tif" << endl;
cin >> outputfile;
system("gm.exe montage -tile 1x10000 -geometry 100% -density 200x200 input.pdf -quality 100 output.tif");
return 0;
}
非常に簡単です。これも可能ですか?
@Matt Coatsの回答はあなたの状況に非常に良いですが、次回は従来のコマンドライン引数処理の使用を検討します。プラットフォームやオーディエンスによっては、これはもっと標準的かもしれません。 –