Latex生成PDF

This commit is contained in:
chengxl
2026-01-07 16:00:54 +08:00
parent a8a06c256e
commit 5dd87bd9fb

View File

@@ -202,6 +202,7 @@ page={{stage_page}},%号
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
$aImageInfo = $this->getImage($sImagePath,$aProductionArticle['p_article_id']);
if(!empty($aImageInfo['data'])){
$aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
$sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
}else{
$sIcon = '';
@@ -582,7 +583,7 @@ page={{stage_page}},%号
$sDir = ROOT_PATH.trim($this->sLatexUrl,'/').'/tex_'.$iId.'/image/';
$sImagePath = $sDir.basename($sPath);
if (file_exists($sImagePath)) {
return ['status' => 1,'msg' => 'success','data' => './image/'.basename($sImagePath)];
return ['status' => 1,'msg' => 'success','data' => $sImagePath];
}
//下载图片
@@ -601,9 +602,12 @@ page={{stage_page}},%号
//保存图片
file_put_contents($sImagePath, $response);
curl_close($ch);
return ['status' => 1,'msg' => 'success','data' => './image/'.basename($sImagePath)];
return ['status' => 1,'msg' => 'success','data' => $sImagePath];
}
/**
* @title curl 图片Latex代码封装
*/
/**
* @title curl 图片Latex代码封装
*/
@@ -629,6 +633,7 @@ page={{stage_page}},%号
$isWideImage = $imageWidth > $wideImageThreshold;
// 生成LaTeX图片代码
$sImageUrl = './image/'.basename($sImageUrl);
if ($isWideImage) {
$latexLines[] = "\\begin{figure*}[htbp]"; // 使用figure*环境实现两栏
$latexLines[] = " \\centering";