mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
.
This commit is contained in:
@ -62,8 +62,7 @@ int main(int argc, char *argv[])
|
||||
#else
|
||||
std::string sParam(argv[i]);
|
||||
#endif
|
||||
if (sParam == "-v" ||
|
||||
sParam == "-version")
|
||||
if (sParam == "-v" || sParam == "-version")
|
||||
{
|
||||
std::cout << "v" VALUE(INTVER) << std::endl;
|
||||
NSDoctRenderer::CDocBuilder oBuilder;
|
||||
@ -101,8 +100,6 @@ int main(int argc, char *argv[])
|
||||
std::wstring sBuildFile = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sBuildFileA.c_str(), (LONG)sBuildFileA.length());
|
||||
#endif
|
||||
|
||||
NSDoctRenderer::CDocBuilder::Initialize();
|
||||
|
||||
if (true)
|
||||
{
|
||||
NSDoctRenderer::CDocBuilder oBuilder;
|
||||
@ -140,7 +137,5 @@ int main(int argc, char *argv[])
|
||||
oBuilder.Run(sBuildFile.c_str());
|
||||
}
|
||||
|
||||
NSDoctRenderer::CDocBuilder::Dispose();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
33
DesktopEditor/doctrenderer/app_builder/test.test
Normal file
33
DesktopEditor/doctrenderer/app_builder/test.test
Normal file
@ -0,0 +1,33 @@
|
||||
builder.CreateFile("docx");
|
||||
var oDocument = Api.GetDocument();
|
||||
var oParagraph, oRun;
|
||||
oParagraph = oDocument.GetElement(0);
|
||||
oParagraph = Api.CreateParagraph();
|
||||
oParagraph.AddText("Dear John Smith.");
|
||||
oDocument.Push(oParagraph);
|
||||
oParagraph = Api.CreateParagraph();
|
||||
oParagraph.AddText("ONLYOFFICE is glad to announce that starting today, you are appointed Commercial director to the company of your dream.");
|
||||
oDocument.Push(oParagraph);
|
||||
oParagraph = Api.CreateParagraph();
|
||||
oRun = Api.CreateRun();
|
||||
oRun.SetBold(true);
|
||||
oRun.AddText("Please note: ");
|
||||
oParagraph.AddElement(oRun);
|
||||
oRun = Api.CreateRun();
|
||||
oRun.AddText("this text is used to demonstrate the possibilities of ");
|
||||
oParagraph.AddElement(oRun);
|
||||
oRun = Api.CreateRun();
|
||||
oRun.SetBold(true);
|
||||
oRun.AddText("ONLYOFFICE Document Builder");
|
||||
oParagraph.AddElement(oRun);
|
||||
oRun = Api.CreateRun();
|
||||
oRun.AddText(" and cannot be used as real appointment to the position in any real company.");
|
||||
oParagraph.AddElement(oRun);
|
||||
oDocument.Push(oParagraph);
|
||||
oParagraph = Api.CreateParagraph();
|
||||
oParagraph.AddText("Best regards,");
|
||||
oParagraph.AddLineBreak();
|
||||
oParagraph.AddText("ONLYOFFICE Document Builder Team");
|
||||
oDocument.Push(oParagraph);
|
||||
builder.SaveFile("docx", "SampleText.docx");
|
||||
builder.CloseFile();
|
||||
Reference in New Issue
Block a user