0
계층화 된 PDF 파일을 만들려면 ABCPDF를 사용해야합니다. 난 워터 마크에 대한 예제를 봤지만 PDF를 두 번째 레이어로 만들어야합니다. 내 코드는 아래와 같습니다. 그것을 실행할 때, 나는 단지 하나의 레이어를 볼 수 있습니다. 내가 뭘 잘못하고 있니?ABCPDF 8 - 계층화 된 PDF를 작성하는 방법
감사합니다.
WebSupergoo.ABCpdf8.Doc artworkDoc = new WebSupergoo.ABCpdf8.Doc();
artworkDoc.SetInfo(0, "License", _License);
WebSupergoo.ABCpdf8.Doc cutDoc = new WebSupergoo.ABCpdf8.Doc();
cutDoc.SetInfo(0, "License", _License);
// Attempt to read in Artwork File
try
{
artworkDoc.Read(ArtworkPath);
}
catch (Exception ex)
{
Exception noartwork = new Exception("Problem with Artwork File: " + ex.ToString());
throw noartwork;
}
// Attempt to read in cut File
try
{
cutDoc.Read(cutPath);
}
catch (Exception ex)
{
Exception nocut = new Exception("Problem with cut File: " + ex.ToString());
throw nocut;
}
WebSupergoo.ABCpdf8.Doc outputDoc = artworkDoc;
outputDoc.SetInfo(0, "License", _License);
// Attempt to merge artwork and cut files into output Document
try
{
outputDoc.PageNumber = 1;
outputDoc.Layer = outputDoc.LayerCount + 1;
outputDoc.AddImageDoc(cutDoc, 1, outputDoc.Rect);
}
catch (Exception ex)
{
Exception problem = new Exception("Problem appending cut and artwork files to output: " + ex.ToString());
throw problem;
}
// Attempt to save the output Document to the specified output path
try
{
outputDoc.Save(OutputPath);
artworkDoc.Clear();
cutDoc.Clear();
outputDoc.Clear();
}
catch (Exception ex)
{
Exception invalidOutput = new Exception("Unable to write output file: " + ex.ToString());
throw invalidOutput;
}
return true;
}
이러한 레이어는 실제로 선택적 콘텐츠 그룹 (OCG)으로 알려져 있습니다. 당신이 ABCpdf에게 그들과 거래하기위한 코드를 요청하면, 당신에게 그것을 보낼 것입니다. – OnceUponATimeInTheWest