I am working in vc++6 and am having an issue.
What I am dooing is a batch process. The process is. Open each PDF Increse the size of the page by adding .5 inch to the top Draw a black Square .5 x .5 Inches. Write the document number in the box in White. Save The document Merge all Documents with MergeFast Open the resulting Document and add a bookmark for each document added to the final PDF.
The issue affects only some PDF documents the .5 inch header is added but it is gray instead of white (Prints white) and the box and text is not added.
So far I have seen this mainly with PDF's created with Pixiel Translations.
Code of the method that is giving issues is below.
{ CSECiSEDDLL ISED; //Custom Wrapper on methods I use from DLL DecryptPDF(filename); long rv; long doclen; //length of document long doc1_id; //document ID double pageh; //pageHeight double pageW; //pageWidth long i; bool rotated;
rv = ISED.LoadFromFile(const_cast <char *> (filename.c_str())); if (rv == 1) { doc1_id = ISED.SelectedDocument(); ISED.SetMeasurementUnits(2); ISED.SetOrigin(origin); //2 doclen = ISED.PageCount(); for(i=1; i <= doclen; i++) { //select page ISED.SelectPage(i); //increase page size pageh = ISED.PageHeight(); pageW = ISED.PageWidth(); rotated = false; if(autorotate) { if(pageW > pageh) { ISED.RotatePage(270); pageh = ISED.PageHeight(); pageW = ISED.PageWidth(); rotated = true; } } pageh += add_to_height; //.6 pageW += add_to_Width; //0 ISED.SetPageDimensions(pageW, pageh); //addnumber if(boxopt.drawbox) { ISED.SetFillColor(boxopt.BoxRed, boxopt.BoxGreen, boxopt.BoxBlue); ISED.SetLineColor(boxopt.BoxRed, boxopt.BoxGreen, boxopt.BoxBlue); ISED.DrawBox(boxopt.Left, boxopt.Top, boxopt.Width, boxopt.Height, boxopt.DrawOptions); } ISED.SetTextAlign(Textopt.TextAlign); ISED.SetTextSize(Textopt.TextSize); ISED.SetTextColor(Textopt.TextRed, Textopt.TextGreen, Textopt.TextBlue); ISED.DrawText(Textopt.XPos, Textopt.YPos, const_cast <char *> (text.c_str())); if (rotated) { ISED.RotatePage(90); } } ISED.SaveToFile (const_cast <char *> (filename.c_str())); } }
|