2017-10-31 1 views
-1

ABCpdf가 지원되지 않습니다 https 이미지를 생성 할 때 pdf을 생성 할 때 십자 기호가 표시됩니다.ABC pdf가 https에 작동하지 않습니다

도와주세요.

당신은 "HTTPS 이미지"무엇

+0

감사? 당신은 HTTP URI를 통해 액세스 된 원격 이미지를 의미합니까? 이 프로세스에서 오류가 발생 했습니까? 해당 웹 사이트에 제대로 로그인 했습니까? [mcve]는 어디에 있습니까? –

답변

0
//Get the HTML. In this example I'm reading the html from a text file (for demonstration purposes) 

string HTML_STRING; 
var streamReader = new StreamReader(@"c:\html.txt"); 
HTML_STRING = streamReader.ReadToEnd(); 
streamReader.Close(); 

//**************************************** 
// Create PDF 
//**************************************** 

//Initiate the document 

var theDoc = new Doc(); 
theDoc.TextStyle.Size = 20; 
theDoc.Rect.Inset(40, 55); 
theDoc.Color.String = "255 255 255"; //Clear rectangle 

//Add the html 
int theId = theDoc.AddImageHtml(HTML_STRING); 

//We now chain subsequent pages together. We stop when we reach a page which wasn't truncated 

while (true) 
{ 
theDoc.FrameRect(); 
if (!theDoc.Chainable(theId)) 
break; 
theDoc.Page = theDoc.AddPage(); 
theId = theDoc.AddImageToChain(theId); 
} 

//////////////////////////////////////////////////// 
// Set pagenumber 
//////////////////////////////////////////////////// 

theDoc.HtmlOptions.LinkPages(); 

//Set the position for the page number 

theDoc.Rect.String = "35 30 580 50"; 
theDoc.Font = theDoc.AddFont("Trebuchet"); 
theDoc.FontSize = 11; 
int pagenumber = 1; 

//flatten the pages. We can't do this until after the pages have been added because flattening will invalidate our previous ID and break the chain. 

for (int i = 1; i <= theDoc.PageCount; i++) 
{ 
theDoc.PageNumber = i; 

//Add page number 
//======================================== 

string txt = pagenumber.ToString(); 
theDoc.Color.String = "169 169 169"; //Dark grey text 

//Positioning depends on if the page is even or odd 
theDoc.VPos = 1.0; 
if ((i%2) == 0) 
{ 
//Even 
theDoc.HPos = 0.01; 
} 
else 
{ 
//Odd 
theDoc.HPos = 0.99; 
} 

//Add the page number 
theDoc.AddText(txt); 

//Add a line above page number 
theDoc.AddLine(21, 55, 590, 55); 

//Flatten page 
theDoc.Flatten(); 

//Increase the page number count 
pagenumber++; 

} 

//============================== 

//////////////////////////////////////////////////// 
// Save the pdf file 
//////////////////////////////////////////////////// 

// Save the document 
theDoc.Save(@"c:\pdf.pdf"); 

//Clear 
theDoc.Clear(); 
+0

정말 고마워요. – user3082965

관련 문제