我正在尝试将图像添加到现有PDF的每个页面的顶部.我尝试过使用PdfStamp,但出于某种原因,当我尝试从Chrome打印pdf时,我得到的是一个黑页.Adobe Reader也只显示原始文档.有没有人对如何使其工作有任何想法?这是代码.
public partial class MakePdf : System.Web.UI.Page
{
public MemoryStream m = new MemoryStream();
protected void Page_Load(object sender, EventArgs e)
{
Document document = new Document(PageSize.LETTER);
Response.ContentType = "application/pdf";
string RESULT = @"C:\Users\maitchison\Documents\Pdf\Service Report Search - 650-10-067 4114.pdf";
PdfReader reader = new PdfReader(RESULT);
PdfStamper stamp = new PdfStamper(reader, m);
try
{
// Set ContentType and create an instance of the Writer.
Response.ContentType = "application/pdf";
PdfWriter writer = PdfWriter.GetInstance(document, m);
writer.CloseStream = false;
// Open Document
document.Open();
int n = …Run Code Online (Sandbox Code Playgroud) 我试图得到MotorRestangular.all('Motors').getList()分配给变量的响应,a以便我以后可以使用它.问题是,如果我尝试访问a我的return函数内部,它是未定义的.我知道这不是完成我需要的正确方法,但我不知道如何以其他方式做到这一点.
myApp.factory('Configurations', function(Restangular, MotorRestangular) {
var a;
var Motors = function() {
MotorRestangular.all('Motors').getList().then(function(Motors){
a = Motors;
});
}
return {
config: function(){
Motors();
console.log(a);
var g = _.groupBy(Motors, 'configuration');
console.log(g);
var mapped = _.map(g, function(m) {
return {
id: m[0].configuration,
configuration: m[0].configuration,
sizes: _.map(m, function(a) {return a.sizeMm})
}});
}
}
});
Run Code Online (Sandbox Code Playgroud) 我使用Report Builder 3.0构建了一个报告,我试图在VS 2010中使用报表查看器显示它.我一直收到此错误消息.
报告定义无效.详细信息:报表定义具有无效的目标命名空间"http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition",无法升级.
这是我正在使用的代码.
public partial class ViewReport : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
PopulateReport(GetDataSet("24"), Server.MapPath("/IncidentReportOld.rdl"));
}
private DataSet GetDataSet(string id)
{
string sql = string.Empty;
SqlDataAdapter ada;
string conString = "Data Source=con-sqlc-02;Initial Catalog=Incident;Integrated Security=True";
DataSet ds = new DataSet();
sql = "select * from Rpt_Incident where incidentID = " + id;
ada = new SqlDataAdapter(sql, conString);
ada.Fill(ds, "Incidents");
return ds;
}
private void PopulateReport(DataSet ds, string reportPath)
{
/* Put the stored …Run Code Online (Sandbox Code Playgroud) asp.net ×2
angularjs ×1
barcode ×1
c# ×1
c#-4.0 ×1
itext ×1
javascript ×1
pdf ×1
promise ×1
restangular ×1