Hello,
I have a problem with acroform modified with WpViewPdf3Olus : in the saved pdf file, fields that i populate by program are not visible and not printed in acrobat reader until the field is focused.
When the field lose focus, his value become not visible.
Fields value are visible only if they are focused or if i modify it manually...
Original pdf file is correct and fields are always visible and printed.
If i print it with wpviewpdf, fields are printed but without style.
Original pdf was created with Acrobat pro XI.
here is what i do :
Code
WPViewPDF1 := TWPViewPDF.CreateParented(Handle);
WPViewPDF1.DLLName := DLLDirectory + 'wPDFViewPlus03.dll';
WPViewPDF1.CommandEx(140, 1);
WPViewPDF1.ViewerStart('', 'M...S', '%...C', 1.....8);
if wpviewpdf1.LoadFromFile(FileName) then begin
// On regarde s'il y a des champs variables //
isChamps := False;
i := 0;
repeat
j := WPViewPdf1.CommandEx(115, i);
if j > 0 then begin
// Il y a un champ donc on va récupérer son contenu //
SetLength(s, j);
WPViewPDF1.CommandEx(261, Integer(PAnsiChar(s)));
//showmessage(s);
j := pos('=', s);
if j = 0 then j := length(s) + 1;
snew := copy(s, j + 1, length(s));
sold := snew;
if pos('#', snew) <>0 then snew := form1.GarniChampsPdf(snew); HERE I REPLACE CONTENT WITH A VARIABLE VALUE
if snew <> sold then begin
isChamps := true;
WPViewPdf1.CommandStrEx(116, snew, i);
end;
end;
inc(i)
until j < 0;
if isChamps then begin
// On enregistre dans un fichier temporaire pour l'édition //
CreateGUID(Guid);
GuidStr := GUIDToString(GUID);
FileName := ExtractFilePath(FileName) + '_temp_' + GuidStr + '.pdf';
WPviewPdf1.Plus.SaveToFile(FileName);
WPviewPdf1.Print('');
end;
end;
Alles anzeigen
thanks for your help