hi,
i buy lic from you
and i can cut the PDF file from code c#
but , sometimes i crashing and the cut PDF not working
can you help me please?
i attache some examples and my lic…
טופס תביעה והוראה לדחות את דרישת צד שלישי.pdf (111.8 KB)
מסמכים ברוקס.pdf (82.3 KB)
טופס תביעה והוראה לדחות את דרישת צד שלישי.pdf (111.8 KB)
מסמכים ברוקס.pdf (82.3 KB)
thanks
Oded
@odedhiba
Could you please share the sample code snippet which you are using at your end to manipulate PDF documents. We will test the scenario in our environment and address it accordingly.
public static bool CutTheFile(string FilePath, int StartCut, int EndCut, string FileRes,bool SplitPDF)
{
bool res = true;
try
{
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(@"\netapp2\users$\Mail2IFN\Aspose.Pdf.lic");
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(FilePath);
Aspose.Pdf.Document docNew = new Aspose.Pdf.Document();
StartCut = 1;
EndCut = doc.Pages.Count;
for (int i = 1; i <= doc.Pages.Count; i++)
{
try
{
if ((SplitPDF) && (res))
{
if (EndCut > 1)
{
if ((i < EndCut) && (i >= StartCut))
{
docNew.Pages.Add(doc.Pages[doc.Pages[i].Number]);
}
}
else
{
if (i >= StartCut)
{
docNew.Pages.Add(doc.Pages[doc.Pages[i].Number]);
}
}
}
else
res = false;
}
catch (Exception e)
{
res = false;
}
}
if(res)
docNew.Save(FileRes);
}
catch(Exception e)
{
res = false;
}
return res;
}
@odedhiba
We have tested the scenario in our environment while using Aspose.PDF for .NET 19.6 and your code snippet. We were unable to notice any issue. The output PDF was not cut from top. For your kind reference, an output PDF is also attached.
OUTPUT.pdf (48.0 KB)
Would you please try using latest version of the API and in case you still face any issue, please share a sample console application which is able to reproduce the error. We will again test the scenario in our environment and address it accordingly.
Working!!!
thank you very much!!!