내 응용 프로그램에서 pdf 보고서를 생성하기 위해 wkhtmltopdf를 사용하고 있지만 pdf가 생성되면 pdf에 로그인 페이지가 있습니다.Wkhtmltopdf symfony2의 로그인 페이지로 리디렉션
이 내 지침 :
public function exportPdfAction($id = 0)
{
$em = $this->container->get('doctrine')->getEntityManager();
$id = $this->get('request')->get($this->admin->getIdParameter());
$object = $this->admin->getObject($id);
if (!$object) {
throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
}
if (false === $this->admin->isGranted('VIEW', $object)) {
throw new AccessDeniedException();
}
$pageUrl = $this->generateUrl('admin_rh_leave_conge_show', array('id'=>$id), true); // use absolute path!
return new Response(
$this->get('knp_snappy.pdf')->getOutput($pageUrl),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="Fiche_conge.pdf"'
)
);
}
내가 어떻게이 문제를 해결할 수 있습니까?
유용한 답을 원한다면 좀 더 자세하게 입력해야 할 것입니다. – cheesemacfly
그래서 내 질문을 업데이트 할 것입니다 – soufiane
내 질문이 업데이트되었습니다 – soufiane