Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class WebservicesTestBlock extends BlockBase {
- public function build() {
- $form = Drupal::formBuilder()->getForm('Drupalwebservices_testFormWebservicesTestForm');
- return $form;
- }
- }
- public function submitForm(array &$form, FormStateInterface $form_state) {
- // here is the code that returns pdf dats
- header("Content-Type: application/pdf");
- header("Content-Disposition: attachment; filename=test.pdf");
- header('Content-Transfer-Encoding: binary');
- //header("Cache-Control", "max-age=0");
- header('Accept-Ranges: bytes');
- ob_clean();
- flush();
- echo ($test->body);
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement