Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to convert an input string of Star Document Markup to a print job data #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CloudPRNTSDKSamples/cputil/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void Main(string[] args)
PrintInputs();
break;

case "decode":
case "decode": {
if(args.Length - i < 3)
{
PrintHelp();
Expand Down Expand Up @@ -85,7 +85,16 @@ static void Main(string[] args)

Console.Error.WriteLine(String.Format("Wrote output to \"{0}\"", outputfile));
break;

}
case "decode-markup": {
string format = args[++i];
string markup_string = args[++i];
byte[] bit_string = System.Text.Encoding.UTF8.GetBytes(markup_string);
Stream s = Console.OpenStandardOutput();
Document.Convert(bit_string, "text/vnd.star.markup", s, format, opts);
s.Close();
break;
}
case "printarea":
if(args.Length - i < 1)
{
Expand Down Expand Up @@ -263,6 +272,7 @@ static void PrintHelp()
" \"image/png\" or \"application/vnd.star.markup\".",
" decode <format> <filename> <output> - Convert file to the specified format. Format should",
" be provides as a media type string.",
" decode-markup <format> <string> - Convert Star Document Markup as string to text/vnd.star.markup format.",
" decoder data is writtenn to the file specified by",
" <output>. If output is set to \"-\" or \"[stdout]\"",
" then data will be written to standard output.",
Expand Down