Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -3667,7 +3667,14 @@ class Production extends Base
|
|||||||
// 方法1: 使用pdflatex命令(推荐)
|
// 方法1: 使用pdflatex命令(推荐)
|
||||||
// $command = "{$sLatexDir}pdflatex -include-directory=" . dirname($texFilePath) .
|
// $command = "{$sLatexDir}pdflatex -include-directory=" . dirname($texFilePath) .
|
||||||
// " -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
|
// " -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
|
||||||
$command = "pdflatex -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
|
// $command = "pdflatex -output-directory=" . $pdfDir . " " . escapeshellarg($texFilePath);
|
||||||
|
$sLatexDir = '/usr/bin/';//latex执行目录
|
||||||
|
$command = sprintf(
|
||||||
|
'%slualatex -interaction=nonstopmode -output-directory=%s %s 2>&1',
|
||||||
|
rtrim($sLatexDir, '/') . '/', // /usr/bin/lualatex
|
||||||
|
escapeshellarg($pdfDir), // 转义输出目录(含空格/特殊字符)
|
||||||
|
escapeshellarg($texFilePath) // 转义tex文件路径
|
||||||
|
);
|
||||||
|
|
||||||
$output = [];
|
$output = [];
|
||||||
$returnVar = 0;
|
$returnVar = 0;
|
||||||
@@ -4338,10 +4345,8 @@ class Production extends Base
|
|||||||
$queue = Queue::push('app\api\job\ArticleCreatePdf@fire', ['p_article_id' => $iPArticleId], 'ArticleCreatePdf');
|
$queue = Queue::push('app\api\job\ArticleCreatePdf@fire', ['p_article_id' => $iPArticleId], 'ArticleCreatePdf');
|
||||||
//生成长表格PDF
|
//生成长表格PDF
|
||||||
$aLongTableId = empty($aResult['long_table_id']) ? [] : $aResult['long_table_id'];
|
$aLongTableId = empty($aResult['long_table_id']) ? [] : $aResult['long_table_id'];
|
||||||
var_dump($aLongTableId);
|
|
||||||
if(!empty($aLongTableId)){ //调用生成长表格队列
|
if(!empty($aLongTableId)){ //调用生成长表格队列
|
||||||
$longtablequeue = Queue::push('app\api\job\ArticleCreateLongTable@fire', ['p_article_id' => $iPArticleId,'long_table_id' => $aLongTableId], 'ArticleCreateLongTable');
|
$longtablequeue = Queue::push('app\api\job\ArticleCreateLongTable@fire', ['p_article_id' => $iPArticleId,'long_table_id' => $aLongTableId], 'ArticleCreateLongTable');
|
||||||
var_dump($longtablequeue);
|
|
||||||
}
|
}
|
||||||
return json_encode(array('status' => 1,'msg' => 'tex file generated successfully'));
|
return json_encode(array('status' => 1,'msg' => 'tex file generated successfully'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,21 +196,23 @@ page={{stage_page}},%号
|
|||||||
//文章图片地址
|
//文章图片地址
|
||||||
$sIcon = empty($aProductionArticle['icon']) ? '' : $aProductionArticle['icon'];
|
$sIcon = empty($aProductionArticle['icon']) ? '' : $aProductionArticle['icon'];
|
||||||
if(!empty($sIcon)){
|
if(!empty($sIcon)){
|
||||||
// $sIconUrl = rtrim(ROOT_PATH).$this->sArticleIcon.'/'.$sIcon;
|
$sIconUrl = ROOT_PATH.trim($this->sArticleIcon,'/').'/'.$sIcon;
|
||||||
// if(file_exists($sIconUrl)){
|
if(file_exists($sIconUrl)){
|
||||||
// $sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
$sIconUrl = str_replace(ROOT_PATH.'public/', '', $sIconUrl);
|
||||||
// }else{
|
$sIconUrl = '../../'.$sIconUrl;
|
||||||
// $sIcon = '';
|
$sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
||||||
// }
|
|
||||||
//下载图片
|
|
||||||
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
|
|
||||||
$aImageInfo = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
|
||||||
if(!empty($aImageInfo['data'])){
|
|
||||||
$aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
|
|
||||||
$sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
|
|
||||||
}else{
|
}else{
|
||||||
$sIcon = '';
|
$sIcon = '';
|
||||||
}
|
}
|
||||||
|
// //下载图片
|
||||||
|
// $sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
|
||||||
|
// $aImageInfo = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||||
|
// if(!empty($aImageInfo['data'])){
|
||||||
|
// $aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
|
||||||
|
// $sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
|
||||||
|
// }else{
|
||||||
|
// $sIcon = '';
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
$aSearch['{{article_icon}}'] = $sIcon;
|
$aSearch['{{article_icon}}'] = $sIcon;
|
||||||
$aSearch['{{keywords}}'] = $sKeywords;
|
$aSearch['{{keywords}}'] = $sKeywords;
|
||||||
@@ -314,21 +316,20 @@ page={{stage_page}},%号
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $sIconUrl = rtrim(ROOT_PATH).$this->sArticleIcon.'/'.$sIcon;
|
$sMainImageUrl = ROOT_PATH.trim($this->sArticleMainImage,'/').'/'.$aImageInfo['url'];
|
||||||
// if(file_exists($sIconUrl)){
|
if(!file_exists($sMainImageUrl)){
|
||||||
// $sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
|
||||||
// }else{
|
|
||||||
// $sIcon = '';
|
|
||||||
// }
|
|
||||||
//下载图片
|
|
||||||
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
|
|
||||||
$aResult = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
|
||||||
if(empty($aResult['data'])){
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// //下载图片
|
||||||
|
// $sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
|
||||||
|
// $aResult = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||||
|
// if(empty($aResult['data'])){
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
// $aImageSearch = ['{{img_url}}' => $aResult['data'],'{{img_title}}' => $aImageInfo['note'],'{{img_fig_sim}}' => 'img_fig_sim_'.$value['ami_id']];
|
// $aImageSearch = ['{{img_url}}' => $aResult['data'],'{{img_title}}' => $aImageInfo['note'],'{{img_fig_sim}}' => 'img_fig_sim_'.$value['ami_id']];
|
||||||
// $sImageTempalteInfo = str_replace(array_keys($aImageSearch), array_values($aImageSearch), $sImageTempalte);
|
// $sImageTempalteInfo = str_replace(array_keys($aImageSearch), array_values($aImageSearch), $sImageTempalte);
|
||||||
$aImageInfo['image_url'] = $aResult['data'];
|
// $aImageInfo['image_url'] = $aResult['data'];
|
||||||
|
$aImageInfo['image_url'] = $sMainImageUrl;
|
||||||
$aDealImage = $this->dealImage($aImageInfo);
|
$aDealImage = $this->dealImage($aImageInfo);
|
||||||
if(empty($aDealImage['data'])){
|
if(empty($aDealImage['data'])){
|
||||||
continue;
|
continue;
|
||||||
@@ -642,7 +643,8 @@ page={{stage_page}},%号
|
|||||||
$isWideImage = $imageWidth > $wideImageThreshold;
|
$isWideImage = $imageWidth > $wideImageThreshold;
|
||||||
|
|
||||||
// 生成LaTeX图片代码
|
// 生成LaTeX图片代码
|
||||||
$sImageUrl = './image/'.basename($sImageUrl);
|
$sImageUrl = str_replace(ROOT_PATH.'public/', '', $sImageUrl);
|
||||||
|
$sImageUrl = '../../'.$sImageUrl;
|
||||||
if ($isWideImage) {
|
if ($isWideImage) {
|
||||||
$latexLines[] = "\\begin{figure*}[htbp]"; // 使用figure*环境实现两栏
|
$latexLines[] = "\\begin{figure*}[htbp]"; // 使用figure*环境实现两栏
|
||||||
$latexLines[] = " \\centering";
|
$latexLines[] = " \\centering";
|
||||||
|
|||||||
Reference in New Issue
Block a user