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

The picture color is change #409

Open
liufeijin opened this issue Jul 27, 2022 · 0 comments
Open

The picture color is change #409

liufeijin opened this issue Jul 27, 2022 · 0 comments

Comments

@liufeijin
Copy link
Contributor

liufeijin commented Jul 27, 2022

Hi fralx
I found that LimeReport preview the png in report is ok. but print to PDF in LimeReport Menu the color will be change in got pdf file
QQ截图20220728110216
P12
TEST.zip

LimeReport::ReportEngine Report2 ;
QString FileFolder;
FileFolder = QFileDialog::getExistingDirectory( 0, "选择要保存PDF的目录",QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
QFile sd; //QFileDevice::WriteUser
if(!FileFolder.trimmed().isEmpty()){
sd.setFileName(FileFolder+"/tt.PDF");
if(sd.exists()){
sd.remove();
}
}else{
TiShi.information(0, tr("选择要保存PDF证书的目录"),tr("要保存PDF证书的目录为空,请选择一个要保存的地方"), QMessageBox::Cancel);
}
QImage P12; // P1保存压缩文件 h.zip

QFile PicFile;
// P1 暂时给老系统 P的压缩包文件了。 以后不用老系统 可以用回来P1字段
PicFile.setFileName(FileFolder+"/P12.png");
qDebug()<<FileFolder+"/P12.png";
if(PicFile.exists()){
P12.load(FileFolder+"/P12.png","png");
}
Report2.loadFromFile(FileFolder+"/TEST.lrxml");
Report2.dataManager()->setReportVariable("P12",P12);

Report2.previewReport();

 Report2.printToPDF(sd.fileName());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant